#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

void func(int N){

	char buf[101];
	int info[N][2];

	scanf("%s",buf);

	for(int i = 0; i < N; i++){
		scanf("%d %d",&info[i][0],&info[i][1]);
		info[i][0]--;
		info[i][1]--;
	}

	for(int i = N-1; i >= 0; i--){
		if(buf[info[i][0]] + info[i][1] - info[i][0] <= 'z'){
			buf[info[i][0]] += info[i][1] - info[i][0];
		}else{
			buf[info[i][0]] = 'a' + (buf[info[i][0]] - 'a' + info[i][1] - info[i][0])%26;
		}

		if(buf[info[i][1]] + info[i][1] - info[i][0] <= 'z'){
			buf[info[i][1]] += info[i][1] - info[i][0];
		}else{
			buf[info[i][1]] = 'a' + (buf[info[i][1]] - 'a' + info[i][1] - info[i][0])%26;
		}

		swap(buf[info[i][0]],buf[info[i][1]]);
	}

	printf("%s\n",buf);

}


int main(){

	int N;

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func(N);
	}

	return 0;
}