#include using namespace std; #include using namespace atcoder; #define itn int #define rep(i,n) for(long long i=0;i<(long long)n;i++) #define reps(i,n) for(long long i=1;i<=(long long)n;i++) #define loop(i,l,r) for(long long i=l;i<=(long long)r;i++) #define drep(i,n) for(long long i=(long long)n-1;i>=0;i--) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define yn(x) cout << (x? "Yes":"No") << endl; #define cou(x) cout << x << endl; #define emp emplace_back #pragma GCC target ("avx,avx2")//四則演算 #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops")//ループ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")//浮動小数点 const long long mod=998244353LL; const long long mods=1000000007LL; const double inf=numeric_limits::infinity(); const int kaz=1000000000; const long long yab=2500000000000000000LL; const long long aho =-yab; const long double eps=1.0e-14L; const long double pi=acosl(-1.0L); using ll=long long; using st=string; using P=pair; using tup=tuple; using vi=vector; using vin=vector; using vc=vector; using vb=vector; using vd=vector; using vs=vector; using vp=vector

; using sp=set

; using si=set; using vvi=vector>; using vvin=vector; using vvc=vector; using vvb=vector; using vvvi=vector; using vvvin=vector; const int dx[4]={0,1,0,-1}; const int dy[4]={1,0,-1,0}; const vector ex = {-1, -1, -1, 0, 0, 1, 1, 1}; const vector ey = {-1, 0, 1, -1, 1, -1, 0, 1}; templateistream&operator>>(istream&is,vector&v){for(T&in:v)is>>in;return is;} templateostream&operator<<(ostream&os,vectorv){rep(i,v.size())os< void co(bool x,T1 y,T2 z){ if(x)cout << y << endl; else cout << z << endl; } template bool chmax(T &a, T b){ if(a bool chmin(T &a, T b){ if(a>b){ a=b; return true; } return false; } template void print(vector &a){ for(int i=0;i0){ if(y&1)ret=ret*x%mod; x=x*x%mod; y>>=1; } return ret; } ll nopow(ll x,ll y){ ll ret=1; while(y>0){ if(y&1)ret*=x; x*=x; y>>=1; } return ret; } ll op(ll a,ll b){ return a+b; } ll e(){ return 0LL; } int main(){ //BCA int n; cin >> n; int q; cin >> q; vi a(n); cin >> a; segtree seg(n); rep(i,n){ if(a[i]==1)seg.set(i,1); else seg.set(i,0); } rep(i,q){ int t,x,y; cin >> t >> x >> y; if(t==1){ x--; if(y==1)seg.set(x,1); else seg.set(x,0); } else { x--;y--; int ok=x-1,ng=y+1; while(ng-ok>1){ int mid=(ok+ng)/2; if(seg.get(mid)==0)ok=mid; else ng=mid; } if(ok==y)ok=-1; if((y-ok)%2==0)cout << 'F' << endl; else cout << 'S' << endl; } } }