class SegmentTree(object): def __init__(self, A, dot, unit): n = 1 << (len(A) - 1).bit_length() tree = [unit] * (2 * n) for i, v in enumerate(A): tree[i + n] = v for i in range(n - 1, 0, -1): tree[i] = dot(tree[i << 1], tree[i << 1 | 1]) self._n = n self._tree = tree self._dot = dot self._unit = unit def __getitem__(self, i): return self._tree[i + self._n] def update(self, i, v): i += self._n self._tree[i] = v while i != 1: i >>= 1 self._tree[i] = self._dot(self._tree[i << 1], self._tree[i << 1 | 1]) def add(self, i, v,ope): self.update(i, ope(self[i],v)) def sum(self, l, r): #これで[l,r)から取り出す。 l += self._n r += self._n l_val = r_val = self._unit while l < r: if l & 1: l_val = self._dot(l_val, self._tree[l]) l += 1 if r & 1: r -= 1 r_val = self._dot(self._tree[r], r_val) l >>= 1 r >>= 1 return self._dot(l_val, r_val) N,Q = map(int,input().split()) ANS = [] A = list(map(int,input().split())) seg = SegmentTree([-1] * N,lambda x,y:max(x,y),-1) for i in range(N): if A[i] == 1: pass else: seg.update(i,i) for _ in range(Q): t,x,y = map(int,input().split()) x-=1 if t == 1: if y ==1 : seg.update(x,-1) else: seg.update(x,x) else: ind = max(seg.sum(x,y),x-1) if (y-ind) % 2 == 1: ANS.append('F') else: ANS.append('S') print(*ANS,sep='\n')