#include <iostream>
using namespace std;

void solve()
{
    int n,q;cin>>q>>q;
    string s;cin>>s;
    while (q--)
    {
        int l,r;cin>>l>>r;
        int i = l-1;int j = r-l+1;
        while (j--)
        {
            string t = "";
            t.push_back(s[i]);
            s.insert(i,t);
            i+=2;
        }
    }
    cout<<s<<'\n';
}
int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);solve();return 0;
}
// 64 位输出请用 printf("%lld")