mystring=input().split() for list_word in mystring: if list_word[0]=='q' or list_word[0]=='Q':print(list_word)