#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
#include <chrono>

static const int MOD1 = 1000000861, MOD2 = 1000000933;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;
class xor_shift {
    uint32_t x, y, z, w;
public:
    xor_shift() : x(static_cast<uint32_t>((chrono::system_clock::now().time_since_epoch().count())&((1LL << 32)-1))),
    y(1068246329), z(321908594), w(1234567890) {};

    uint32_t urand(){
        uint32_t t;
        t = x ^ (x << 11);
        x = y; y = z; z = w;
        w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
        return w;
    };

    int rand(int n){
        if(n < 0) return -rand(-n);
        uint32_t t = numeric_limits<uint32_t>::max()/(n+1)*(n+1);
        uint32_t e = urand();
        while(e >= t) e = urand();
        return static_cast<int>(e%(n+1));
    }

    int rand(int a, int b){
        if(a > b) swap(a, b);
        return a+rand(b-a);
    }
};


xor_shift rd;

template<int M>
struct rolling_hash {
    static ll &B() {
        static ll B_ = rd.rand(2, M-1);
        return B_;
    }
    static vector<ll> &p() {
        static vector<ll> p_{1, B()};
        return p_;
    }
    vector<ll> hash;
    explicit rolling_hash(const string &s) {
        if(p().size() <= s.size()){
            int l = p().size();
            p().resize(s.size()+1);
            for (int i = l; i < p().size(); ++i) {
                p()[i] = (p()[i-1]*p()[1])%M;
            }
        }
        hash.resize(s.size()+1, 0);
        for (int i = 0; i < s.size(); ++i) {
            hash[i+1] = (hash[i]*B() + s[i]) % M;
        }
    };

    ll get(int l, int r){
        ll res = hash[r]+M-hash[l]*p()[r-l]%M;
        return res >= M ? res-M : res;
    }
};


vector<rolling_hash<MOD1>> hashs1;
vector<rolling_hash<MOD2>> hashs2;

template <class M>
struct LazySegmentTree{
    using T = typename M::T;
    using L = typename M::L;
    int sz, height{};
    vector<T> seg; vector<L> lazy;
    explicit LazySegmentTree(int n) {
        sz = 1; while(sz < n) sz <<= 1, height++;
        seg.assign(2*sz, M::e());
        lazy.assign(2*sz, M::l());
    }

    void set(int k, const T &x){
        seg[k + sz] = x;
    }

    void build(){
        for (int i = sz-1; i > 0; --i) seg[i] = M::f(seg[i<<1], seg[(i<<1)|1]);
    }

    T reflect(int k){ return lazy[k] == M::l() ? seg[k] : M::g(seg[k], lazy[k]); }

    void eval(int k){
        if(lazy[k] == M::l()) return;
        lazy[(k<<1)|0] = M::h(lazy[(k<<1)|0], lazy[k]);
        lazy[(k<<1)|1] = M::h(lazy[(k<<1)|1], lazy[k]);
        seg[k] = reflect(k);
        lazy[k] = M::l();
    }
    void thrust(int k){ for (int i = height; i; --i) eval(k>>i); }
    void recalc(int k) { while(k >>= 1) seg[k] = M::f(reflect((k<<1)|0), reflect((k<<1)|1));}
    void update(int a, int b, const L &x){
        thrust(a += sz); thrust(b += sz-1);
        for (int l = a, r = b+1;l < r; l >>=1, r >>= 1) {
            if(l&1) lazy[l] = M::h(lazy[l], x), l++;
            if(r&1) --r, lazy[r] = M::h(lazy[r], x);
        }
        recalc(a);
        recalc(b);
    }

    T query(int a, int b){ // [l, r)
        thrust(a += sz);
        thrust(b += sz-1);
        T ll = M::e(), rr = M::e();
        for(int l = a, r = b+1; l < r; l >>=1, r>>=1) {
            if (l & 1) ll = M::f(ll, reflect(l++));
            if (r & 1) rr = M::f(reflect(--r), rr);
        }
        return M::f(ll, rr);
    }
};

struct Monoid{
    using T = array<ll, 3>;
    using L = char;
    static T f(T a, T b) {
        return {(a[0]*rolling_hash<MOD1>::p()[b[2]]+b[0])%MOD1, (a[1]*rolling_hash<MOD2>::p()[b[2]]+b[1])%MOD2, a[2]+b[2]};
    }
    static T g(T a, L b) {
        if(b == l()) return a;
        else {
            return {hashs1[b-'a'].get(0, a[2]), hashs2[b-'a'].get(0, a[2]), a[2]};
        }
    }
    static L h(L a, L b) {
        if(b == l()) return a; else return b;
    }
    static T e() { return {0, 0, 0}; }
    static L l() { return 0; }
};

int main() {
    int n;
    string s;
    cin >> n >> s;
    for (int i = 'a'; i <= 'z'; ++i) {
        hashs1.emplace_back(string(n, i));
        hashs2.emplace_back(string(n, i));
    }
    LazySegmentTree<Monoid> seg(n);
    for (int i = 0; i < n; ++i) {
        seg.set(i, {s[i], s[i], 1});
    }
    seg.build();
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i) {
        string qq;
        cin >> qq;
        if(qq == "comp"){
            int a, b, c, d;
            cin >> a >> b >> c >> d;
            a--; c--;
            int ok = 0, ng = min(b-a+1, d-c+1);
            while(ng-ok > 1){
                int mid = (ok+ng)/2;
                if(seg.query(a, a+mid) == seg.query(c, c+mid)) ok = mid;
                else ng = mid;
            }
            if(a+ok == b && c+ok == d){
                puts("e");
            }else if(a+ok == b){
                puts("s");
            }else if(c+ok == d){
                puts("t");
            }else if(seg.query(a+ok, a+ng) < seg.query(c+ok, c+ng)){
                puts("s");
            }else {
                puts("t");
            }
        }else {
            int a, b; char c;
            cin >> a >> b >> c;
            a--;
            seg.update(a, b, c);
        }
    }
    return 0;
}


Measured memory_bytes: 100544