t = int(input()) for _ in range(t): s = input() if s[:10] == 'simon says': print(s[11:]) else: print()