import sys input = sys.stdin.readline sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 # A = [ int(input()) for _ in range(N) ] ############################## A1, B1, A2, B2, A3, B3 = map(int, input().split()) a = str(A1**B1)[-1] b = str(A2**B2)[-1] c = str(A3**B3)[-1] ans = int(a)+int(b)+int(c) if ans %2 == 0: print(':-)') else: print(':-(')