A1,B1,A2,B2,A3,B3 = map(int,input().split()) MOD = 10**9+7 if (pow(A1,B1,MOD)+pow(A2,B2,MOD)+pow(A3,B3,MOD))%2 == 0: print(":-)") else: print(":-(")