#!usr/bin/python #-*- coding: UTF-8 -*- li=map(str,raw_input().strip().split()) for m in li: a=m[0] if a=="q" or a=="Q": print m