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

char solve2( char c, int a ) {
    char answer = c - 'a';
    // cout << c << endl;
    // cout << c << ',' << a << endl;
    for ( int i = 0; i < a; i++ ) {
        answer = ( answer + 1 ) % 26;
    }
    // cout << (char)( answer + 'a' ) << endl;
    // cout << (char)( answer + 'a' ) << endl;
    return ( answer + 'a' );
}

string solve( string input, int a, int b ) {
    input[a-1] = solve2( input[a-1], b );
    return input;
}

int main() {
    int n;
    while ( cin >> n && n ) {
        string input;
        cin >> input;
        
        int A[n], B[n];
        for ( int i = 0; i < n; i++ ) {
            cin >> A[i] >> B[i];
            A[i]--;
            B[i]--;
        }
        
        for ( int i = n-1; i >= 0; i-- ) {
            int a = A[i];
            int b = B[i];
            swap( input[a], input[b] );
            input[a] = solve2( input[a], abs( a - b ) );
            input[b] = solve2( input[b], abs( a - b ) );
        }
        
        cout << input << endl;
    }
    return 0;
}