c=[] while True: try: c.append((raw_input()).split()) except EOFError: break for i in c[::-1]: print(" ".join(x for x in i[::-1]))