Inversion of a String

Interview

Time limit2sMemory limit512 MB

Summary
Reverse the substring of S from position A to position B, keep the rest unchanged, and print the resulting string.
Level

Easy1 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

You are given a string S of length N.

If you reverse the order of the characters from the A-th character to the B-th character of S and leave the other characters unchanged, what string do you get? The first character of S is the 1st character, and the last character is the N-th character.

Given a string S and two integers A, B, write a program that prints the string obtained by reversing the order of the characters from the A-th character to the B-th character of S.

Input

The input is given from standard input in the following format.

N A B
S

Output

Print on one line the string obtained by reversing the order of the characters from the A-th character to the B-th character of S.

Constraints

  • 1 ≦ A ≦ B ≦ N ≦ 200.
  • S is a string of length N.
  • Each character of S is an uppercase or lowercase English letter.

Examples2

  1. Example 1

    Input
    10 3 7
    JOIjoiJoIj
    
    Expected output
    JOJiojIoIj
    
  2. Example 2

    Input
    9 6 6
    abcdefghi
    
    Expected output
    abcdefghi