#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int main(){
  int n;
  int a[110],b[110];
  string str;

  while(cin >> n , n){
    cin >> str;

    for(int i=0;i<n;i++){
      cin >> a[i] >> b[i];
      a[i]--; b[i]--;
    }

    for(int i=n-1;i>=0;i--){
      int s = b[i]-a[i];
      str[a[i]] = (char)('a' + (str[a[i]] + s -'a')%26);
      str[b[i]] = (char)('a' + (str[b[i]] + s -'a')%26);
      swap(str[a[i]],str[b[i]]);
    }
    cout << str << endl;
  }
}