import re tcase = raw_input() word = re.sub("[^\w]", " ",tcase).split() ss=0 for ss in word : if ss[0]=='q' or ss[0]=='Q': print ss