N, Q = map(int, input().split()) A = [1 if i == 1 else 0 for i in list(map(int, input().split()))] TXY = [list(map(int, input().split())) for _ in range(Q)] # N: 処理する区間の長さ N0 = 2 ** (N).bit_length() data = [0] * (2 * N0) # a_k の値を x に更新 def update(k, x): k += N0 - 1 data[k] = x while k >= 0: k = (k - 1) // 2 data[k] = min(data[2 * k + 1], data[2 * k + 2]) # 区間[l, r)の最小値 def query(l, r): s = 1 L = l + N0; R = r + N0 while L < R: if R & 1: R -= 1 s = min(s, data[R - 1]) if L & 1: s = min(s, data[L - 1]) L += 1 L >>= 1; R >>= 1 return s for i, a in enumerate(A): update(i, a) for t, x, y in TXY: if t == 1: if y == 1: update(x - 1, 1) else: update(x - 1, 0) else: if query(y - 1, y) == 0: print("F") continue if query(0, y) == 1: if (y - x) % 2 == 1: print("S") else: print("F") continue lb = x - 1 ub = y while ub - lb > 1: mid = (ub + lb) // 2 if query(mid - 1, y) == 1: ub = mid else: lb = mid if (y - ub) % 2 == 0: print("S") else: print("F")