#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
  int n;
  int a[110];
  int b[110];
  string s;
  while(cin >> n, n) {
    cin >> s;
    for(int i = 0; i < n; i++) {
      cin >> a[i] >> b[i];
    }

    for(int i = n-1; i >= 0; i--) {
      int x = b[i]-a[i];
      int p = a[i]-1, q = b[i]-1;
      swap(s[p], s[q]);
      
      s[p] = (s[p]-'a'+x)%26 + 'a';
      s[q] = (s[q]-'a'+x)%26 + 'a';
    }
  cout << s << endl;
  }
}