#include <string>
#include <iostream>

#pragma warning(disable : 4996)

using namespace std;

int N, A[100], B[100]; string S;

int main()
{
	while (true)
	{
		scanf("%d", &N);

		if (N == 0) break;

		cin >> S;

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

		for (int i = N - 1; i >= 0; i--)
		{
			swap(S[A[i] - 1], S[B[i] - 1]);

			int sa = B[i] - A[i];

			S[A[i] - 1] = ((int)(S[A[i] - 1] - 'a') + sa) % 26 + 'a';
			S[B[i] - 1] = ((int)(S[B[i] - 1] - 'a') + sa) % 26 + 'a';
		}

		cout << S << endl;
	}

	return 0;
}