The first line contains the string S. Its length is at least 1 and at most 100, and it consists only of uppercase and lowercase English letters and hyphens (−).
The second line contains the number of swaps T, where 1≤T≤50.
Each of the following T lines contains two integers A and B separated by a space. A and B are integers with 0≤A,B<∣S∣, where the first character of the string is position 0.