#include using namespace std; #include using namespace atcoder; //高速化 struct ponjuice{ponjuice(){cin.tie(0);ios::sync_with_stdio(0);cout<using vc = vector; templateusing vvc = vc>; templateusing vvvc = vvc>; using vi = vc; using vvi = vvc; using vvvi = vvvc; using vl = vc; using vvl = vvc; using vvvl = vvvc; using pi = pair; using pl = pair; using ull = unsigned ll; templateusing priq = priority_queue; templateusing priqg = priority_queue, greater>; // for文 #define overload4(a, b, c, d, e, ...) e #define rep1(n) for(ll i = 0; i < n; i++) #define rep2(i, n) for(ll i = 0; i < n; i++) #define rep3(i, a, b) for(ll i = a; i < b; i++) #define rep4(i, a, b, step) for(ll i = a; i < b; i+= step) #define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define per1(n) for(ll i = n-1; i >= 0; i--) #define per2(i, n) for(ll i = n-1; i >= 0; i--) #define per3(i, a, b) for(ll i = b-1; i >= a; i--) #define per4(i, a, b, step) for(ll i = b-1; i >= a; i-= step) #define per(...) overload4(__VA_ARGS__, per4, per3, per2, per1)(__VA_ARGS__) #define fore1(a) for(auto&& i : a) #define fore2(i,a) for(auto&& i : a) #define fore3(x,y,a) for(auto&& [x, y] : a) #define fore4(x,y,z,a) for(auto&& [x, y, z] : a) #define fore(...) overload4(__VA_ARGS__, fore4, fore3, fore2, fore1)(__VA_ARGS__) //関数 #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define si(x) (ll)(x).size() templateinline bool chmax(S& a, T b){return a < b && ( a = b , true);} templateinline bool chmin(S& a, T b){return a > b && ( a = b , true);} templatevoid uniq(vc&a){sort(all(a));a.erase(unique(all(a)),a.end());} templatevc operator++(vc&v,signed){auto res = v;fore(e,v)e++;return res;} templatevc operator--(vc&v,signed){auto res = v;fore(e,v)e--;return res;} templatevc operator++(vc&v){fore(e,v)e++;return v;} templatevc operator--(vc&v){fore(e,v)e--;return v;} //入出力(operator) templateistream&operator>>(istream&is,static_modint&a){ll v;is>>v;a=v;return is;} istream&operator>>(istream&is,modint&a){ll v;cin>>v;a=v;return is;} templateistream&operator>>(istream&is,pair&a){is>>a.a>>a.b;return is;} templateistream&operator>>(istream&is,vc&a){fore(e,a)is>>e;return is;} templateostream&operator<<(ostream&os,static_modinta){return os<ostream&operator<<(ostream&os,pair&a){return os<ostream&operator<<(ostream&os,set&a){fore(it,a){os<ostream&operator<<(ostream&os,multiset&a){fore(it,a){os<ostream&operator<<(ostream&os,map&a){fore(x,y,a){os<ostream&operator<<(ostream&os,unordered_set&a){fore(it,a){os<ostream&operator<<(ostream&os,unordered_map&a){fore(x,y,a){os<ostream&operator<<(ostream&os,vc&a){fore(e,a)os<ostream&operator<<(ostream&os,vvc&a){fore(e,a)os<>a;return a;} vl readvl(ll n){vl a(n);cin>>a;return a;} vvi readg(ll n,ll m,bool bidirected=true){vvi g(n);rep(i,m){ll a,b;cin>>a>>b;a--;b--;g[a].emplace_back(b);if(bidirected)g[b].emplace_back(a);}return g;} vvcreadgc(ll n,ll m,bool bidirected=true){vvc g(n);rep(i,m){ll a,b,c;cin>>a>>b>>c;a--;b--;g[a].emplace_back(b,c);if(bidirected)g[b].emplace_back(a,c);}return g;} vvi readt(ll n,bool bidirected=true){return readg(n,n-1,bidirected);} vvc readtc(ll n,bool bidirected=true){return readgc(n,n-1,bidirected);} inline void yes(){cout << "Yes\n";} inline void no(){cout << "No\n";} inline void yesno(bool y = true){if(y)yes();else no();} inline void print(){cout<inline void print(T a){cout<inline void print(T a,Ts ...b){cout<>t; while(t--)solve(); } using S=array; using F=array; const S Inf = {0}; const F ID = {0,0}; S op(S a, S b){ S res; rep(i,27) res[i] = a[i]+b[i]; return res; } S e(){ return Inf; } S mapping(F f, S x){ S res; res[0] = (x[0]+f[0]) % 26; rep(i,1,27) res[i] = x[(i - 1 + f[1])%26 + 1]; return res; } F composition(F f, F g){ F res; res[0] = (f[0]+g[0]) % 26; res[1] = (f[1]+g[1]) % 26; return res; } F id(){ return ID; } void solve(){ string s,t; cin >> s >> t; int n = min(si(s),si(t)); lazy_segtree seg(n); rep(i, n){ S a = {0}; a[0] = s[i]-'a'; a[(t[i] - s[i] + 26) % 26 + 1] = 1; seg.set(i,a); } int q; cin >> q; rep(i,q){ int T; cin >> T; if(T == 1 || T == 2){ int l,r,x; cin >> l >> r >> x; l--; r = min(r,n); l = min(l,n); cout << l << " " << r << " " << n << endl; seg.apply(l, r, {T == 1 ? x: 0, T == 1 ? x : 26-x}); }else{ int p; cin >> p; p--; int r = seg.max_right(p, [&](S x){rep(i,1,26) if(x[i+1])return false; return true;}); if(r == n){ if(si(s) == si(t)){ cout << "Equals" << endl; } if(si(s) < si(t)){ cout << "Lesser" << endl; } if(si(s) > si(t)){ cout << "Greater" << endl; } }else{ S res = seg.get(r); ll st = res[0]; rep(i,26){ if(res[i+1]){ st = (st + i) % 26; } } if(res[0] < st){ cout << "Lesser" << endl; } if(res[0] > st){ cout << "Greater" << endl; } } } } }