#include <stdio.h>
#define MAX_N 100

int iabs(int a){
	if(a < 0){
		return -a;
	}
	return a;
}

void swap(char *a,char *b){
	char tmp;
	tmp = *a;
	*a = *b;
	*b = tmp;
}



int main(void){
	int n, a[MAX_N], b[MAX_N], i, sub;
	char message[101];
	while(1){
		scanf("%d",&n);
		if(n == 0){
			break;
		}
		scanf("%s",message);

		for(i = 0;i < n;i++){
			scanf("%d%d",&a[i],&b[i]);
			a[i]--;b[i]--;

		}
		for(i = n - 1;i >= 0;i--){
			sub = iabs(a[i] - b[i]);
			message[a[i]] = (message[a[i]] - 'a' + 26 + sub) % 26 + 'a';
			message[b[i]] = (message[b[i]] - 'a' + 26 + sub) % 26 + 'a';
			swap(&message[a[i]],&message[b[i]]);
		}

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


	}
	return 0;
}