def change(moji, nums) -> str: min_num = min(int(nums[0]), int(nums[1])) max_num = max(int(nums[0]), int(nums[1])) return moji[:min_num] + moji[max_num] \ + moji[min_num + 1:max_num] + moji[min_num] \ + moji[max_num + 1:] inp_str = input() irekae = list(input().split()) print(change(inp_str, irekae))