N = int(input()) S = input() last = None for i in range(N): if S[i] in "AGCT": last = i if last == None: print (0) else: print (last+1)