#include<iostream>
#include<string>
#include<vector>

using namespace std;

struct DATA{
  int a;
  int b;
};

void SwapCipher(char&, char&, int);
int Search(string, char);

int main(){
  int i, n, a, b;
  string str;
  DATA _data;
  vector<DATA> data;

  while(1){
    cin >> n;
    if(n == 0) break;

    cin >> str;

    for(i=0; i<n; ++i){
      cin >> a >> b;
      _data.a = a-1;
      _data.b = b-1;
      data.push_back(_data);
    }

    for(i=data.size()-1; i>=0; --i)
      SwapCipher(str[data[i].a], str[data[i].b], data[i].b-data[i].a);

    cout << str << endl;
    data.clear();
  }
  return 0;
}

void SwapCipher(char& c1, char& c2, int x){
  int a, b;
  string data = "abcdefghijklmnopqrstuvwxyz";
  a = (Search(data, c1) + x)%data.size();
  b = (Search(data, c2) + x)%data.size();
  c1 = data[b];
  c2 = data[a];
}

int Search(string data, char c){
  int i;
  for(i=0; i<data.size(); ++i){
    if(c == data[i]) return i;
  }
  return -1;
}