/******************************
     AUTHOR KRISH MURARKA
*******************************/
#include<bits/stdc++.h>
using namespace std;
#define ll                 long long int
#define mod                1000000007
#define modulo             998244353
#define popcount           __builtin_popcount     //used to count number of set bits in a integer
#define llpopcount         __builtin_popcountll   
#define parity             __builtin_parity // returns true(1) if number has odd parity i.e odd no of set bits
#define llparity           __builtin_parityll 
#define leadzero           __builtin_clz  //returns number of leading zeros of a 32 bit int 
#define llleadzero         __builtin_clzll // returns number of leading zero of a 64 bit int 
#define trailzero          __builtin_ctz  // returns number of trailing zero 
#define lltrailzero        __builtin_ctzll 
#define f                  first
#define s                  second
#define pb                 push_back
#define ppb                pop_back
#define inf                (ll)(1e18)
#define rep(i,a,b)         for(int i=a;i<b;i++)
#define pll                pair<ll,ll>
#define ppl                pair<pair<ll,ll>>
#define mem1(a)            memset(a,-1,sizeof(a))
#define mem0(a)            memset(a,0,sizeof(a))
#define fast               ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define deb(x)             cout<<#x<<" "<<x<<"\n"
#define uid(l,r)           uniform_int_distribution<int>(l,r); // to use auto temp= uid(l,r). int x= temp(rng); to generate from [L,R]
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;} // only use in equations like sum=max(sum,x)  its equivalent ot amax(sum,x) => sums is changed automatically
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 

void read_input()
{
  #ifndef ONLINE_JUDGE
  freopen("inputA.txt","r",stdin);
  freopen("outputA.txt","w",stdout);
  #endif
}
vector<ll> v[1005];
void solving()
{
   ll n;
   cin>>n;
   string s;
   cin>>s;
   ll q;
   cin>>q;
   string t1=s.substr(0,n);
   string t2=s.substr(n);
   bool flag=true;
   while(q-->0)
   {
     int t;
     ll a,b;
     cin>>t>>a>>b;  
     a--;b--;
     if(t==1)
     {

        // if flag =false string order temp1+temp2
        // else string order temp2+temp1


        
          int left=a;
          int right=b;
           if(left<n && right<n)
           {
              if(flag)
              {
                swap(t1[right],t1[left]);
              }
              else
              {
                swap(t2[right],t2[left]);
              }
           }
           else if(left<n && right>=n)
           {
              right-=n;
               if(flag)
               {
                  int temp=t1[left];
                  t1[left]=t2[right];
                  t2[right]=temp;
               }
               else
               {
                 int temp=t2[left];
                 t2[left]=t1[right];
                 t1[right]=temp;
               }
           }
            else
            {
               left-=n;
               right-=n;
               if(flag)
               {
                 swap(t2[left],t2[right]);
               }
               else
               {
                  swap(t1[left],t1[right]);
               }
            }
     }
     else
     {
        flag=!flag;
     }
    }


    if(flag)
    {
      cout<<(t1+t2)<<"\n";
    }
    else
      cout<<(t2+t1)<<"\n";
}
int main()
{
    fast;
    read_input();
    int t=1;
    //cin>>t;
    for(int i=1;i<=t;i++)
    {  
    //cout<<"Case #"<<i<<": ";
     solving();
    }
    return 0;
}
#include <bits/stdc++.h>
#include <string>
#include <map>
#include <set>
#include <sstream> 
#include <queue>
#include <stack>
#include <deque>
#include <vector>
 
#define loop(i,a,b) for (int i = (a); i <= (b); i++)
#define loopr(i, a, b) for(int i = (a); i >= (b); i--)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define pf 				push_front
#define mp              make_pair
#define mt              make_tuple
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(x) (int)x.size()
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define mod 1000000007
#define mod1 998244353
using namespace std; 
 
int fast_pow(int a, int p) {
  int res = 1;
  while (p) {
    if (p % 2 == 0) {
      a = a * 1ll * a % mod;
      p /= 2;
    } else {
      res = res * 1ll * a % mod;
      p--;
    }
  }
  return res;
}
 
int fact(int n) {
  int res = 1;
  for (int i = 1; i <= n; i++) {
    res = res * 1ll * i % mod;
  }
  return res;
}
 
int C(int n, int k) {
  return fact(n) * 1ll * fast_pow(fact(k), mod - 2) % mod * 1ll * fast_pow(fact(n - k), mod - 2) % mod;
}
 
vector<int> sieveOfEratosthenes(int n) {
	vector<int> primes;
	vector<bool> prime(n+1,true);
	for (int p = 2; p * p <= n; p++) {
		if (prime[p] == true) {
			for (int i = p * p; i <= n; i += p)
				prime[i] = false;
		}
	}
	for (int p = 2; p <= n; p++)
		if (prime[p])
			primes.push_back(p);
	return primes;
}
 
 
bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    // This is checked so that we can skip  
    // middle five numbers in below loop 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
 
int highestPowerof2(int n) 
{ 
   int p = (int)log2(n); 
   return (int)pow(2, p);  
} 

int modd(string num, int a) 
{ 
    // Initialize result 
    int res = 0; 
  
    // One by one process all digits of 'num' 
    for (int i = 0; i < num.length(); i++) 
         res = (res*10 + (int)num[i] - '0') %a; 
  
    return res; 
}  
 
int32_t main()
{	
	fast_io;
	int n;
	cin>>n;
	string s;
	cin>>s;
	int q;
	cin>>q;
	int cnt = 0;
	while(q--)
	{
		int t,a,b;
		cin>>t>>a>>b;
		if(t==1)
		{		
			if(cnt&1)
			{
				if(a>b)
				{
					swap(a,b);
				}
				if(a<=n and b>n)
				{
					swap(s[a-1+n],s[b-1-n]);
				}
				else if(a<=n and b<=n)
				{
					swap(s[a-1+n],s[b-1+n]);
				}
				else if(a>n and b>n)
				{
					swap(s[a-1-n],s[b-1-n]);
				}
			}
			else
			{
				swap(s[a-1],s[b-1]);
			}
		}
		else
		{
			cnt++;
		}
	//	cout<<s<<endl;
	}
	string r = "";
	if(cnt&1)
	{
		loop(i,n,2*n-1)
		{
			r+=s[i];
		}
		loop(i,0,n-1)
		{
			r+=s[i];
		}
	}
	else
	{
	//	reverse(s.begin(),s.end());
		r = s;
	}
	cout<<r<<endl;
}