using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(int n) => Enumerable.Repeat(0, n).Select(_ => NList).ToArray(); static void Main() { Solve(); } static void Solve() { var c = NList; var (n, q) = (c[0], c[1]); var a = NList; var map = NArr(q); var ft = new FenwickTree(n + 1); for (var i = 0; i < n; ++i) if (a[i] == 1) ft.Add(i + 1, 1); var res = new List(); foreach (var que in map) { if (que[0] == 1) { if (ft.Sum(que[1]) == ft.Sum(que[1] - 1)) { if (que[2] == 1) ft.Add(que[1], 1); } else { if (que[2] > 1) ft.Add(que[1], -1); } } else { var sr = ft.Sum(que[2]); // WriteLine($"1s = {sr - ft.Sum(que[1] - 1)}"); if (sr - ft.Sum(que[1] - 1) == que[2] - que[1] + 1) { if ((que[2] - que[1] + 1) % 2 == 1) res.Add('F'); else res.Add('S'); } else { var ok = que[2]; var ng = que[1] - 1; while (ok - ng > 1) { var mid = (ok + ng) / 2; // WriteLine($"{sr} - {ft.Sum(mid)} == {que[2]} - {mid}"); if (sr - ft.Sum(mid) == que[2] - mid) ok = mid; else ng = mid; } // WriteLine($"1start = {ok}"); if ((que[2] - ok) % 2 == 0) res.Add('F'); else res.Add('S'); } } // for (var i = 0; i < n; ++i) Write((ft.Sum(i + 1) - ft.Sum(i)) + " "); // WriteLine(); } WriteLine(string.Join("\n", res)); } class FenwickTree { int size; long[] tree; public FenwickTree(int size) { this.size = size; tree = new long[size + 2]; } public void Add(int index, int value) { ++index; for (var x = index; x <= size; x += (x & -x)) tree[x] += value; } /// 先頭からindexまでの和(include index) public long Sum(int index) { ++index; var sum = 0L; for (var x = index; x > 0; x -= (x & -x)) sum += tree[x]; return sum; } } }