Problem:
Score: 100 points

Problem Statement

E869120's and square1001's 16-th birthday is coming soon.

Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.

E869120 and square1001 were just about to eat A and B of those pieces, respectively,

when they found a note attached to the cake saying that "the same person should not take two adjacent pieces of cake".

Can both of them obey the instruction in the note and take desired numbers of pieces of cake?

Constraints

A and B are integers between 1 and 16 (inclusive).

A+B is at most 16.

Input

Input is given from Standard Input in the following format:

A B

Output

If both E869120 and square1001 can obey the instruction in the note and take desired numbers of pieces of cake, print Yay!; otherwise, print :(.

Sample Input 1

5 4

Sample Output 1

Yay!

Both of them can take desired number of pieces as follows:

Sample Input 2

8 8

Sample Output 2

Yay!

Both of them can take desired number of pieces as follows:

Sample Input 3

11 4

Sample Output 3

:(

In this case, there is no way for them to take desired number of pieces, unfortunately.

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<bits/stdc++.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopb(i,a,b) for(int i=a;i>=b;i--)
#define loopm(i,a,b,step) for(int i=a;i<b;i+=step)
#define loopbm(i,a,b,step) for(int i=a;i>=b;i-=step)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define INF 1000000007
#define MOD 1000000007
#define BINF 1000000000000000001
#define int long long int
#define double long double

using namespace std;

int dp[1005][1005][8];
int a[1005][8];
bool visited[1005][1005][8];

int go(int n,int k,int idx)
{

	if(n<0)
	{
		return 0;
	}
	else if(n+1==k)
	{
		int sum=0;
		loop(i,0,n+1) sum+=a[i][idx];
		return sum;
	}
	
	else if(visited[n][k][idx]==true) return dp[n][k][idx];
	else if(k==0) return 0;
	else
	{
		visited[n][k][idx]=true;
		dp[n][k][idx]=max(go(n-1,k,idx),go(n-1,k-1,idx)+a[n][idx]);
		return dp[n][k][idx];
	}
}


#undef int
int main()
{
#define int long long int
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
  //  freopen("input.txt","r",stdin);
 int n;
 cin>>n;
 int m;
 cin>>m;
 int x[n],y[n],z[n];
 loop(i,0,n) cin>>x[i]>>y[i]>>z[i];
 
 int X[n][8],Y[n][8],Z[n][8];
 
loop(i,0,8)
{
	loop(j,0,n)
	{
		if(i%2==0) X[j][i]=x[j];
		else X[j][i]=-x[j];
		if(i==0 or i==1 or i==4 or i==5) Y[j][i]=y[j];
		else Y[j][i]=-y[j];
		if(i==0 or i==1 or i==2 or i==3) Z[j][i]=z[j];
		else Z[j][i]=-z[j];
	}
}



loop(i,0,8)
{
	loop(j,0,n)
	{
		a[j][i]=X[j][i]+Y[j][i]+Z[j][i];
	}
}

int ans=-BINF;

loop(i,0,1005)
{
	loop(j,0,1005)
	{
		loop(k,0,8){ dp[i][j][k]=-BINF; visited[i][j][k]=false;}
	}
}

loop(i,0,8)
{
	int curr=go(n-1,m,i);
	ans=max(ans,curr);
}
 cout<<ans;
 
    return 0;
}