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()) if (pow(a1, b1)%MOD+pow(a2, b2)%MOD+pow(a3, b3)%MOD)%2 == 0: print(':-)') else: print(':-(')