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

int k(int a) {
	for (int i = 0;; i++) {
		if (a - 26 * i >= 'a'&&a - 26 * i <= 'z')return a-26*i;
	}
}
int main() {
	int a;
	while (cin>>a,a) {
		string b;
		cin >> b;
		int x[100], y[100];
		for (int c = 0; c < a; c++) {
			scanf("%d%d", &x[c], &y[c]); x[c]--; y[c]--;
		}
		for (int i = a - 1; i >= 0; i--) {
			int d = (int)b[x[i]]+abs(x[i]-y[i]), e = (int)b[y[i]] + abs(x[i] - y[i]);
			d = k(d); e = k(e);
			b[x[i]] = e; b[y[i]] = d;
		}
		cout << b << endl;
	}
}