print("""P2 100 100 9""") import sys for l in sys.stdin.read().splitlines(): for c in l: print(9-int(c))