AtCoder Beginner Contest 100 - Happy Birthday!

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-----
5 4

-----Sample Output-----
Yay!

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

Difficulty: EASY

Starter code:

Solutions:
(a, b) = map(int, input().split())
if a <= 16 / 2 and b <= 16 / 2:
	print('Yay!')
else:
	print(':(')


(a, b) = map(int, input().split())
print('Yay!' if a <= 8 and b <= 8 else ':(')


(A, B) = map(int, input().split())
if A <= 8 and B <= 8:
	print('Yay!')
else:
	print(':(')


(a, b) = map(int, input().split())
print('Yay!' if a < 9 and b < 9 else ':(')


(a, b) = map(int, input().split())
if abs(a - b) > 2:
	print(':(')
else:
	print('Yay!')


(a, b) = map(int, input().split())
if a > 8 or b > 8:
	print(':(')
else:
	print('Yay!')


(A, B) = map(int, input().split())
print(['Yay!', ':('][A > 8 or B > 8])


print('Yay!' if max(list(map(int, input().split()))) < 9 else ':(')


(A, B) = map(int, input().split())
print(['Yay!', ':('][max(A, B) > 8])


(a, b) = map(int, input().split(' '))
print([':(', 'Yay!'][max(a, b) < 9])


(A, B) = map(int, input().split())
ans = 'Yay!' if max(A, B) <= 8 else ':('
print(ans)


(a, b) = map(int, input().split())
print('Y:a(y !'[a // 9 | b // 9::2])


(a, b) = map(int, input().split())
print([':(', 'Yay!'][a < 9 and b < 9])


a = list(map(int, input().split()))
print('Yay!' if all((x <= 8 for x in a)) else ':(')


lst = input().split()
a = int(lst[0])
b = int(lst[1])
if a <= 8 and b <= 8:
	print('Yay!')
else:
	print(':(')


(A, B) = map(int, input().split())
print([':(', 'Yay!'][A <= 8 and B <= 8])


(A, B) = map(int, input().split())
if max(A, B) <= 8:
	print('Yay!')
	exit()
print(':(')


(a, b) = [int(x) for x in input().split()]
print('Yay!' if a <= 8 and b <= 8 else ':(')


print('Yay!' if all(map(lambda num: int(num) <= 8, input().split())) else ':(')


(a, b) = map(int, input().split())
print('Yay!' if abs(a - b) <= 1 else ':(')


(A, B) = map(int, input().split())
print('Yay!' if A < 9 and B < 9 else ':(')


ans = 'Yay!'
(a, b) = map(int, input().split())
if a > 8 or b > 8:
	ans = ':('
print(ans)


(a, b) = map(int, input().split())
print([':(', 'Yay!'][max(a, b) <= 8])


if max(map(int, input().split())) <= 8:
	print('Yay!')
else:
	print(':(')


(A, B) = map(int, input().split())
print(':(' if A > 8 or B > 8 else 'Yay!')


(a, b) = map(int, input().split())
print('Y:a(y !'[a > 8 or b > 8::2])


(A, B) = map(int, open(0).read().split())
print('Yay!' if A <= 8 and B <= 8 else ':(')


(n, m) = map(int, input().split())
if n < 9 and m < 9:
	print('Yay!')
else:
	print(':(')


(a, b) = map(int, input().split())
if a > 8 or b > 8:
	print(':(')
	exit()
print('Yay!')


s = input()
print([':(', 'Yay!'][len(s) < 4 * ('9' not in s)])


(A, B) = [int(x) for x in input().split()]
print('Yay!' if max(A, B) <= 8 else ':(')


import sys

def input():
	return sys.stdin.readline().rstrip()

def main():
	print('Yay!' if all([True if int(x) < 9 else False for x in input().split()]) else ':(')

def __starting_point():
	main()
__starting_point()


from functools import reduce

def solve(a, b):
	if a <= 8 and b <= 8:
		return 'Yay!'
	else:
		return ':('

def main():
	(a, b) = list(map(int, input().split()))
	print('{}'.format(solve(a, b)))

def __starting_point():
	main()
__starting_point()


(a, b) = list(map(int, input().split()))
print('Yay!' if max(a, b) <= 8 else ':(')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
from collections import deque
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def main():
	(A, B) = LI()
	if A < 9 and B < 9:
		print('Yay!')
	else:
		print(':(')
main()


(A, B) = map(int, input().split())
print(':(') if A >= 9 or B >= 9 else print('Yay!')


(a, b) = map(int, input().split())
print(['Yay!', ':('][a > 8 or b > 8])


(x, y) = map(int, input().split())
res = 'Yay!'
if x > 8 or y > 8:
	res = ':('
print(res)


(A, B) = map(int, input().split())
if abs(A - B) <= 1:
	print('Yay!')
else:
	print(':(')


import sys
input = sys.stdin.readline
(a, b) = map(int, input().split())
c = max(a, b)
d = min(a, b)
e = 16 - 2 * c
if e < 0:
	print(':(')
elif e // 2 >= c - d:
	print('Yay!')
else:
	print(':(')


(a, b) = [int(x) for x in input().split()]
print(['Yay!', ':('][a > 8 or b > 8])


(A, B) = map(int, input().split())
ans = 'Yay!'
if A > 8 or B > 8:
	ans = ':('
print(ans)


x = input()
y = x.split()
a = int(y[0])
b = int(y[1])
if a > 8 or b > 8:
	print(':(')
else:
	print('Yay!')


print([':(', 'Yay!'][max(map(int, input().split())) < 9])


print(['Yay!', ':('][max(map(int, input().split())) > 8])


s = input()
print(':(' if len(s) > 3 or '9' in s else 'Yay!')


(a, b) = map(int, input().split())
c = abs(a - b)
print('Yay!' if a + b + c <= 16 else ':(')


(a, b) = map(int, input().split())
print('Yay!' if 9 > max(a, b) else ':(')


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(a, b) = Input()
	if a <= 8 and b <= 8:
		print('Yay!')
	else:
		print(':(')
main()


(x, y) = input().split()
if int(x) <= 8 and int(y) <= 8:
	print('Yay!')
else:
	print(':(')


print(['Yay!', ':(', ':('][sum([int(x) > 8 for x in input().split()])])


(a, b) = map(int, input().split())
print(':Y(a y !'[16 - a - b >= max(a, b) - min(a, b)::2])


(a, b) = map(int, input().split())
if a >= 9 or b >= 9:
	print(':(')
else:
	print('Yay!')


t = input()
print(['Yay!', ':('][len(t) > 3 or '9' in t])


def get_input() -> tuple:
	(A, B) = list(map(int, input().split()))
	return (A, B)

def main(A: int, B: int) -> None:
	ans = str()
	if A <= 8 and B <= 8:
		ans = 'Yay!'
	else:
		ans = ':('
	print(ans)

def __starting_point():
	(A, B) = get_input()
	main(A, B)
__starting_point()


print([':(', 'Yay!'][eval('max(' + input().replace(' ', ',') + ')') <= 8])


(n, k) = map(int, input().split())
if abs(n - k) > 2:
	print(':(')
else:
	print('Yay!')


(a, b) = map(int, input().split())
print([':(', 'Yay!'][a <= 8 and b <= 8])


(x, y) = map(int, input().split())
if x > 8 or y > 8:
	print(':(')
else:
	print('Yay!')


import sys
import math
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inm = lambda : map(int, sys.stdin.readline().split())
inl = lambda : list(inm())
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))
(A, B) = inm()
if A <= 8 and B <= 8:
	print('Yay!')
else:
	print(':(')


print(':(') if 0 in [0 for i in input().split() if int(i) > 8] else print('Yay!')


s = input()
print(['Yay!', ':('][len(s) > 3 or '9' in s])


A = list(map(int, input().split()))
print('Yay!' if max(A) <= 8 else ':(')


print('Yay!' if max([int(i) for i in input().split()]) <= 8 else ':(')


(A, B) = map(int, input().split())
print(':Y(a y !'[(A <= 8) * (B <= 8)::2])


def main():
	(a, b) = list(map(int, input().split()))
	if a <= 8 and b <= 8:
		print('Yay!')
	else:
		print(':(')

def __starting_point():
	main()
__starting_point()


print([':(', 'Yay!'][all((i < 9 for i in map(int, input().split())))])


import sys
(A, B) = list(map(int, input().split()))
if A <= 8 and B <= 8:
	print('Yay!')
else:
	print(':(')


print('Yay!' if all([x < 9 for x in map(int, input().split())]) else ':(')


print('Yay!' if all((int(i) <= 8 for i in input().split())) else ':(')


(n, m) = map(int, input().split())
print('Yay!' if n <= 8 and m <= 8 else ':(')


(x, y) = map(int, input().split())
if x < 9 and y < 9:
	print('Yay!')
else:
	print(':(')


(A, B) = [int(x) for x in input().split()]
print('Yay!' if A < 9 and B < 9 else ':(')


(a, b) = map(int, input().split())
res = ':('
if a <= 8 and b <= 8:
	res = 'Yay!'
print(res)


print(':Y(a y !'[eval(input().replace(' ', '<9>'))::2])


M = max([int(x) for x in input().split()])
print('Yay!' if M <= 8 else ':(')


print('Yay!' if all((int(tok) <= 8 for tok in input().split())) else ':(')


(x, y) = map(int, input().split())
print(['Yay!', ':('][x > 8 or y > 8])


(A, B) = map(int, input().split())
print([':(', 'Yay!'][A < 9 and B < 9])


print(['Yay!', ':(', ':('][sum([int(i) // 9 for i in input().split()])])


(n, m) = [int(x) for x in input().split()]
if n < 9 and m < 9:
	print('Yay!')
else:
	print(':(')


(a, b) = map(int, input().split())
if abs(a - b) > 0:
	if a + b + abs(a - b) < 17:
		print('Yay!')
	else:
		print(':(')
else:
	print('Yay!')


(a, b) = list(map(int, input().split()))
if a <= 8 and b <= 8:
	print('Yay!')
	return
print(':(')


(A, B) = list(map(int, input().split()))
ans = str()
if A <= 8 and B <= 8:
	ans = 'Yay!'
else:
	ans = ':('
print(ans)


(a, b) = list(map(int, input().split()))
if max(a, b) - min(a, b) <= 1:
	print('Yay!')
else:
	print(':(')


l = list(map(int, input().split()))
if l[0] <= 8 and l[1] <= 8:
	print('Yay!')
else:
	print(':(')


(N, K) = map(int, input().split())
print('Yay!' if N <= 8 and K <= 8 else ':(')


import sys

def input():
	return sys.stdin.readline().strip()

def I():
	return int(input())

def LI():
	return list(map(int, input().split()))

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def S():
	return input()

def LS():
	return input().split()
INF = float('inf')
(a, b) = LI()
if a <= 8 and b <= 8:
	print('Yay!')
else:
	print(':(')


(A, B) = map(int, input().split())
if max(A, B) >= 9:
	print(':(')
else:
	print('Yay!')


(a, b) = input().split()
a = int(a)
b = int(b)
if a <= 8:
	if b <= 8:
		print('Yay!')
	else:
		print(':(')
else:
	print(':(')