#include <bits/stdc++.h>
/* #include <atcoder/lazysegtree> */
using namespace std;
/* using namespace atcoder; */
using pint = pair<int, int>;
using ll = long long;
using ull = unsigned long long;
using vint = vector<int>;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#define FOR(i, begin, end) \
    for (long long i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) \
    for (long long i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define VREP(s, ite) for (auto ite = s.begin(); ite != s.end(); ++ite)
#define FI first
#define SE second
#define ALL(v) v.begin(), v.end()
#define endl "\n"
#define ciosup  \
    cin.tie(0); \
    ios::sync_with_stdio(false);
#define eb emplace_back
constexpr ll INF = 1e15 + 7LL;
constexpr ll MOD = 998244353LL;

template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
    for (int i = 0; i < v.size(); ++i) {
        is >> v[i];
    }
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    if (v.size() == 0) return os;
    for (int i = 0; i < v.size() - 1; ++i) {
        os << v[i] << " ";
    }
    os << v[v.size() - 1];
    return os;
}
template <typename... T>
void In(T&&... args) {
    (std::cin >> ... >> args);
}
template <typename T, typename ...Tail>
void Out(T head, Tail... tail) {
    std::cout << head;
    if constexpr(sizeof...(tail) > 0) {
        std::cout << ' ';
        Out(tail...);
    } else {
        std::cout << '\n';
    }
}
template <typename T>
T& chmin(T& val, T val2) {
    return val = min(val, val2);
}
template <typename T>
T& chmax(T& val, T val2) {
    return val = max(val, val2);
}

void solve() {
    int n; In(n);
    string s; In(s);
    int q; In(q);
    int ocnt = 0;
    REP(iii,q) {
        int t,a,b; In(t,a,b);
        if (t == 1) {
            --a;--b;
            if (ocnt % 2 == 1) {
                swap(s[(a+n)%(2*n)], s[(b+n)%(2*n)]);
            } else {
                swap(s[a], s[b]);
            }
        } else {
            ++ocnt;
        }
    }
    if (ocnt % 2 == 1) {
        REP(i,n) {
            swap(s[i], s[i+n]);
        }
    }
    Out(s);
}

int main() {
    solve();
    /* char tmp; */
    /* while (cin >> tmp) { */
    /*     cin.putback(tmp); */
    /*     solve(); */
    /* } */
}

/*
    Author: Alam Khan
    AUST CSE 40th Batch

*/

#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
#define pb     push_back
#define inf     2e18
#define low     -2e18
#define PI        acos(-1.0)
#define endl  "\n"
#define FAST  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fr freopen("input.txt","r",stdin)
#define fw freopen("output.txt","w",stdout)
const int sz = 3e5+9;
ll a[sz],b[sz];
string str,str2;
bool f = 0;
ll get(ll ind,ll n)
{
    if(!f)
        return ind;
    if(ind<=n)
        return n+ind;
    return ind-n;
}
int main()
{
    ll i,n,t,k,j,x=0,y=0,m;
    FAST
    cin>>n>>str;
    cin>>m;
    while(m--)
    {
        cin>>k>>x>>y;
        if(k==1)
        {
            swap(str[get(x,n)-1],str[get(y,n)-1]);
        }
        else
        {
            f = !f;
        }
    }
    if(f)
        cout<<str.substr(n,n)<<str.substr(0,n)<<endl;
    else
        cout<<str<<endl;

    return 0;
}


