#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  while(1){
  int n;
  cin>>n;
  if(n==0)break;
  string str;
  cin>>str;
  int A[101],B[101];
  for(int i=0;i<n;i++)cin>>A[i]>>B[i];

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