Reverse a substring
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
In a given string s was chosen a substring of characters from the i-th to the j-th inclusive (characters in the string s are numbered starting from one). Then was swapped the i-th symbol with the j-th, (i + 1)-th with (j - 1)-th and so on (the substring was reversed). Print the string s after all changes are done.
Input
The first line contains the string s that is no longer than 1000 characters, the second line contains the numbers i and j (i ≤ j).
Output
Print the string s after all changes.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 9K
Acceptance rate 49%