#include <bits/stdc++.h>
using namespace std;
// #include<atcoder/all>
// using namespace atcoder;
using ll = long long;
#define rep(i, e) for (ll i = (ll)0; i < (ll)e; i ++)
#define repd(i, s) for (ll i = (ll)s; i > (ll)0; i--)
#define reps(i, s, e, p) for (ll i = (ll)s; i < (ll)e; i += p)
#define repsd(i, s, e, p) for (ll i = (ll)s; i > (ll)e; i -= p)
#define ALL(vec) vec.begin(), vec.end()

int main(){
    int n, q;
    string s;
    cin >> n >> s >> q;

    int t, a, b, r = 0;
    rep (i, q){
        cin >> t >> a >> b;
        if (t == 1){
            if (r == 0){
                swap(s[a - 1], s[b - 1]);
            }else{
                if (a <= n) a += n;
                else a -= n;

                if (b <= n) b += n;
                else b -= n;

                swap(s[a - 1], s[b - 1]);
            }
        }else r = 1 - r;
    }

    cout << (r == 0 ? s.substr(0, n) + s.substr(n, n) : s.substr(n, n) + s.substr(0, n)) << endl;
    
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
  float n, D, H; cin >> n >> D >> H;
  float ans = 0;
  for (int i = 0; i < n; i++){
    float d, h; cin >> d >> h;
    ans = max(ans, H - (D * (H - h) / (D - d)));
  }
  cout << ans << endl;
}