import sys map = { 1 : '0 0 0\n0 1 0\n0 0 0', 2 : '0 0 1\n0 0 0\n1 0 0', 3 : '1 0 0\n0 1 0\n0 0 1', 4 : '1 0 1\n0 0 0\n1 0 1', 5 : '1 0 1\n0 1 0\n1 0 1', 6 : '1 0 1\n1 0 1\n1 0 1', } #for line in sys.stdin: # print map[int(line)], '\n' try: while True: print map[int(raw_input())] + "\n" except EOFError: pass