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