#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define PB push_back
#define MP make_pair

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}

int main(void){
  int n;

  while(cin >> n && n){
    string str;
    cin >> str;
    int a,b;
    vector<pair<int,int> > encrypt;

    for(int i=0;i<n;i++){
      cin >> a >> b;
      encrypt.PB(MP(a-1,b-1));
    }

    for(int i=n-1;i>=0;i--){
      int diff = encrypt[i].second - encrypt[i].first;
      int x,y;

      x = str[encrypt[i].first];
      y = str[encrypt[i].second];


      x += diff;
      y += diff;
      
      while(!('a' <= x && x <= 'z')){
	x -= 'z' - 'a' + 1;
      }
      while(!('a' <= y && y <= 'z')){
	y -= 'z' - 'a' + 1;
      }
      str[encrypt[i].first] = x;
      str[encrypt[i].second] = y;

      swap(str[encrypt[i].first],str[encrypt[i].second]);
    }
    cout << str << endl;
  }
}