#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
int main(){
  int n;
  string in;
  while(cin>>n && n){
    cin>>in;
    vector<pair<int,int> > a(n);
    for(int i=0;i<n;i++)cin>>a[i].first>>a[i].second;
    for(int i=n-1;i>=0;i--){
      int b[2]={a[i].first-1,a[i].second-1};
      swap(in[b[0]],in[b[1]]);
      int dif= abs(b[0]-b[1]);
      for(int j=0;j<2;j++){
	in[b[j]]=(in[b[j]]-'a'+dif)%26+'a';
      }
    }
    cout << in << endl;
  }
}