#include #include using namespace std; using namespace atcoder; int main() { int N, Q; cin >> N >> Q; vector A(N); fenwick_tree fw(N); for( int i = 0; i < N; i++ ) { cin >> A[i]; A[i] = ( A[i] == 1 ); fw.add(i, A[i]); } for( int q = 0; q < Q; q++ ) { int T, X, Y; cin >> T >> X >> Y; if( T == 1 ) { X--; Y = ( Y == 1 ); if( A[X] == 0 && Y == 1 ) fw.add(X, 1); else if( A[X] == 1 && Y == 0 ) fw.add(X, -1); }else { X--; Y--; int l = X, r = Y+1, m; while( l < r ) { m = (l+r)>>1; if( fw.sum(m, Y+1) != Y+1-m ) l = m+1; else r = m; } int k = Y+1-l; if( l == X ) { if( k&1 ) cout << 'F' << endl; else cout << 'S' << endl; }else { if( k&1 ) cout << 'S' << endl; else cout << 'F' << endl; } } } }