def main(): x, y = map(int, input().split()) ans = [(x + 4) % 12, (x + 8) % 12] ans.remove(y) print(*ans) if __name__ == "__main__": main()