#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define F first
#define S second
#define INF 1 << 30

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int main(){
  int N;
  while(scanf("%d", &N) && N){
    char mes[128];
    scanf("%s", mes);
    int a[128], b[128];
    for(int i = N - 1; i >= 0; i--) scanf("%d%d", &a[i], &b[i]);

    rep(i, N){
      int c = a[i]-1, d = b[i]-1;
      char t = mes[c]; mes[c] = mes[d]; mes[d] = t;
      int dis = d - c;
      dis %= 26;
      if(mes[c] + dis > 'z') mes[c] -= 26;
      mes[c] += dis;
      if(mes[d] + dis > 'z') mes[d] -= 26;
      mes[d] += dis;
    }

    puts(mes);
  }
  return 0;
}