n,q=list(map(int,input().split())) a=list(map(int,input().split())) for _ in range(n): t,k,y=list(map(int,input().split())) if t==0: a[x-1]=y elif a[1:y-1].count('1')%2==0: print("F") else: print("S")