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 Java8 (OpenJDK 1.8.0) (judge verdict: Runtime Error)

import java.util.Scanner;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Comparator;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Long[][] a = new Long[N][3];
        for(int i =0;i<N;i++){
            a[i][0] = sc.nextLong();
            a[i][1] = sc.nextLong();
            a[i][2] = sc.nextLong();
        }
        PriorityQueue<Long> pq = new PriorityQueue<>(Comparator.reverseOrder());
        pq.add(Search(M,N,a,1L,1l,1l));
        pq.add(Search(M,N,a,1l,1l,-1l));
        pq.add(Search(M,N,a,1l,-1l,1l));
        pq.add(Search(M,N,a,1l,-1l,-1l));
        pq.add(Search(M,N,a,-1l,1l,1l));
        pq.add(Search(M,N,a,-1l,1l,-1l));
        pq.add(Search(M,N,a,-1l,-1l,1l));
        pq.add(Search(M,N,a,-1l,-1l,-1l));
        System.out.print(pq.poll());
        sc.close();
    }
    public static Long Search(int M,int N,Long[][] L,Long x,Long y,Long z){
        PriorityQueue<Long> pq2 = new PriorityQueue<>(Comparator.reverseOrder());
        Long ans = 0l;
        for(int i = 0; i<N;i++){
            pq2.add(L[i][0]*x+L[i][1]*y+L[i][2]*z);
        }
        for(int i = 0; i<M;i++){
            ans += pq2.poll();
        }
        return ans;
    }
}