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

int main(){
	int n,a[101],b[101];
	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 d = abs( a[i] - b[i] );
			int i_ = a[i]-1;
			int j = b[i]-1;
			s[i_] = ((s[i_]-'a'+d)%26) + 'a';
			s[j] = ((s[j]-'a'+d)%26) + 'a';
			char t = s[i_];
			s[i_] = s[j];
			s[j] = t;
		}
		cout << s << endl;
	}
}