# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
//long long MOD = 1000000000 + 7;//1000000000 + 7 998244353 924844033 1000000000 + 9;
constexpr long long INF = 1LL << 60;//numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<double, double> Dll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourth; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Rrep(i,mf) for(LL i=mf-1;i>=0;i--)
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
struct Edge { LL to, cost; };
struct edge {
	LL from, to, cost;
};
vector<vector<LL>>g;
vector<edge>ed;
vector<Pll>pv;
set<LL>st;
map<Pll, LL>ma;
int di[4][2] = { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } };
string str, ss;
bool f;
LL n, m, s, t, h, w, k,q, ans,sum, cnt,a[20];

const int P = 1685440109;
const int MOD = 2000000087;
class SegmentTree{
private:
	static const LL INIT_DATA=0;
	static const char INIT_DELAY = '\0';
	LL updateData(LL prev, int len, LL x) {
		//現在の範囲がすべて文字xで更新された場合
		if (x == INIT_DELAY)
			return prev;
		else
			return x * pPowSum[len] % MOD;
	}
	char updateDelay(char x1, char x2) {
		//x1にx2を伝播する
		if (x2 == INIT_DELAY)
			return x1;
		else
			return x2;
	}
	LL uniteData(LL v1, int len1, LL v2, int len2) {
		return (v1 + v2 * pPow[len1]) % MOD;
	}
	vector<long long> pPow, pPowSum;
	int n;
	vector<LL> node;
	vector<char> delay;
	void updateTree(int a, int b, int k, int l, int r, char x) {
		//[l,r]
		if (a <= l && r <= b) {
			node[k] = updateData(node[k], r - l + 1, x);
			delay[k] = updateDelay(delay[k], x);
		}
		else if (a <= r && l <= b) {
			int len = (r - l + 1) / 2;
			for (int i = 0; i<2; ++i) {
				node[k * 2 + 1 + i] = updateData(node[k * 2 + 1 + i], len, delay[k]);
				delay[k * 2 + 1 + i] = updateDelay(delay[k * 2 + 1 + i], delay[k]);
			}
			delay[k] = INIT_DELAY;
			updateTree(a, b, k * 2 + 1, l, (l + r) / 2, x);
			updateTree(a, b, k * 2 + 2, (l + r + 1) / 2, r, x);
			node[k] = uniteData(node[k * 2 + 1], len, node[k * 2 + 2], len);
		}
	}
	LL getValue(int a, int b, int k, int l, int r) {
		if (a <= l && r <= b) {
			return node[k];
		}
		else if (a <= r && l <= b) {
			int len = (r - l + 1) / 2;
			for (int i = 0; i<2; ++i) {
				node[k * 2 + 1 + i] = updateData(node[k * 2 + 1 + i], len, delay[k]);
				delay[k * 2 + 1 + i] = updateDelay(delay[k * 2 + 1 + i], delay[k]);
			}
			delay[k] = INIT_DELAY;
			int len1 = max(0, min(b, (l + r) / 2) - max(a, l) + 1);
			int len2 = max(0, min(b, r) - max(a, (l + r + 1) / 2) + 1);
			LL v1 = getValue(a, b, k * 2 + 1, l, (l + r) / 2);
			LL v2 = getValue(a, b, k * 2 + 2, (l + r + 1) / 2, r);
			return uniteData(v1, len1, v2, len2);
		}
		else {
			return INIT_DATA;
		}
	}
public:
	SegmentTree(int n0) {
		n = 1;
		while (n < n0)
			n *= 2;
		node.assign(2 * n - 1, INIT_DATA);
		delay.assign(2 * n - 1, INIT_DELAY);
		pPow.resize(n + 1, 1);
		pPowSum.resize(n + 1, 0);
		for (int i = 1; i <= n; ++i) {
			pPow[i] = pPow[i - 1] * P % MOD;
			pPowSum[i] = pPowSum[i - 1] + pPow[i - 1];
		}
	}
	void update(int a, int b, char x) {
		updateTree(a, b, 0, 0, n - 1, x);
	}
	LL get(int a, int b) {
		return getValue(a, b, 0, 0, n - 1);
	}
};
SegmentTree seg(210000);
int main() {
	cin >> n;
	cin >> str;
	cin >> q;
	rep(i, str.size())seg.update(i, i, str[i]);
	rep(i, q) {
		LL x, y, z, w;
		char c;
		cin >> ss;
		if (ss == "comp") {
			cin >> x >> y >> z >> w;
			x--, y--, z--, w--;
			LL size = min(y - x, w - z);
			LL l = -1, r = size + 1, mid;
			while (r-l>1) {
				mid = (l + r) / 2;
				LL s1 = seg.get(x, x + mid);
				LL s2 = seg.get(z, z + mid);
				if (s1 == s2)
					l = mid;
				else
					r = mid;
			}
			if (l == size) {
				if (y - x == w - z)
					cout << "e" << endl;
				else if (y - x < w - z)
					cout << "s" << endl;
				else
					cout<<"t"<<endl;
			}
			else {
				if (seg.get(x + l+1, x + l+1) < seg.get(z + l+1, z + l+1)) 
					cout << "s" << endl;
				else
					cout << "t" << endl;
			}
		}
		else {
			cin >> x >> y >> c;
			x--, y--;
			seg.update(x, y, c);
		}
	}
	return 0;
}



Measured memory_bytes: 12048