#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c0){ if(b%2) ret *= num; num = num * num; b /= 2; } }else{ while(b>0){ if(b%2) ret = (ret*num)%p; num = (num*num)%p; b /= 2; } } return ret; } int main(int argc, char const *argv[]) { ll a, b, c, d, e, f;std::cin >> a >> b >> c >> d >> e >> f; ll x = mpow(a, b); ll y = mpow(c, d); ll z = mpow(e, f); std::cout << ((x+y+z)%3==0?":-)":":-(") << '\n'; }