#include<iostream>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<stack>
#include<queue>
#include<string>

using namespace std;

int main(void){
  int n;
  string str;
  while(cin>>n,n){  
  vector<int> aa(n);
  vector<int> bb(n);
  int a,b;
  cin>>str;
  for(int i = n - 1 ; i>=0 ; i --){
    cin>>aa[i]>>bb[i];
  }
  for(int i = 0 ; i < n ; i ++){
    aa[i]--,bb[i]--;
    char sw = ((str[aa[i]] - 'a' + abs( aa[i] - bb[i]))%26)+'a';
    str[aa[i]] = ((str[bb[i]] - 'a' + abs(aa[i] - bb[i]))%26)+'a';
    str[bb[i]] = sw;
  }
  cout<<str<<endl;
  }
}