Problem:
 ﻿Score: 100 points    Problem Statement  In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e , respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k . Determine if there exists a pair of antennas that cannot communicate directly . Here, assume that the distance between two antennas at coordinates p and q ( p < q ) is q - p .      Constraints   a, b, c, d, e and k are integers between 0 and 123 (inclusive).  a < b < c < d < e         Input  Input is given from Standard Input in the following format:  a  b  c  d  e  k       Output  Print :( if there exists a pair of antennas that cannot communicate directly , and print Yay! if there is no such pair.        Sample Input 1 1
2
4
8
9
15      Sample Output 1 Yay!  In this case, there is no pair of antennas that cannot communicate directly, because:   the distance between A and B is 2 - 1 = 1  the distance between A and C is 4 - 1 = 3  the distance between A and D is 8 - 1 = 7  the distance between A and E is 9 - 1 = 8  the distance between B and C is 4 - 2 = 2  the distance between B and D is 8 - 2 = 6  the distance between B and E is 9 - 2 = 7  the distance between C and D is 8 - 4 = 4  the distance between C and E is 9 - 4 = 5  the distance between D and E is 9 - 8 = 1   and none of them is greater than 15 . Thus, the correct output is Yay! .       Sample Input 2 15
18
26
35
36
18      Sample Output 2 :(  In this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18 , so they cannot communicate directly.
Thus, the correct output is :( .

Solution (Python):
A = input()
B = input()
C = input()
D = input()
E = input()
K = input()

if B-A<=K and C-A<=K and D-A<=K and E-A<=K and C-B<=K and D-B<=K and E-B<=K and D-C<=K and E-C<=K and E-D<=K:
  print "Yay!"
else:
  print ":("

Solution (Python):
A = [int(input()) for i in range(5)]
K = int(input())
print(':(' if K < A[-1]-A[0] else 'Yay!')

Solution (Python):
import itertools

result = 0
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
list_in = [a,b,c,d,e]
list_in = sorted(list_in)

for i in itertools.permutations([a,b,c,d,e], r=2):
    i = sorted(i)
    if i[1]-i[0] > k:
      result = 1

if result == 1:
  print(":(")
else:
  print("Yay!")

Solution (Python):
li = [int(input()) for i in range(6)]

for i in range(5):
    for j in range(5):
        if (li[j] - li[i]) > li[-1] and i!=j:
            print(":(")
            quit()

print("Yay!")

Solution (Python):
antenna = [int(input()) for _ in range(5)]
d = int(input())

import itertools
i = 0
for v in itertools.combinations(antenna, 2):
    if abs(v[0]-v[1]) > d:
        print(":(")
        break
    else:
        pass
    i += 1
if i == 10:
    print("Yay!")

Solution (Python):
inputs = [0,0,0,0,0]
inputs[0] = int(input())

inputs[1] = int(input())

inputs[2] = int(input())

inputs[3] = int(input())

inputs[4] = int(input())

k = int(input())

flag = True
for i in range(0,5):
	for j in range(0,i):
		if inputs[i] - inputs[j] > k:
			flag = False

if flag:
	print("Yay!")
else:
	print(":(")

Solution (Python):
import collections as c
ip = lambda : map(int, input().split())



A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
k = int(input())

for i in [A,B,C,D,E]:
    for j in [A,B,C,D,E]:
        if abs(i-j)>k:
            print(':(')
            exit()
print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
    print("Yay!")
else:
    print(":(")

Solution (Python):
l = [int(input()) for i in range(5)]
k = int(input())

f = 'Yay!'
for i in range(5):
    for j in range(5):
        if abs(l[i] - l[j]) > k:
            f = ':('
            break

print(f)

Solution (Python):
import sys
antenna = [int(input()) for _ in range(5)]
k = int(input())
 
for i in range(len(antenna)):
  for j in range(len(antenna)):
    if antenna[i]-antenna[j]>k:
      print(":(")
      sys.exit()
print("Yay!")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a,b,c,d,e]
k = int(input())

com = k + a
count = 0
for i in range(5):
    if(l[i] > com):
        count += 1
if(count > 0):
    print(":(")
else:
    print("Yay!")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=[b-a,c-b,d-c,e-d]
 
if((f[0]>k) or (f[1]>k) or (f[2]>k)or (f[3]>k)):
  print(':(')
elif(((f[0]+f[1])>k)or ((f[1]+f[2])>k)or ((f[2]+f[3])>k)):
  print(':(')
elif(((f[0]+f[1]+f[2])>k) or((f[1]+f[2]+f[3])>k)):
  print(':(')
elif((e-a)>k):
  print(':(')
else:
  print('Yay!')

Solution (Python):
A = []
for i in range(6):
    A.append(int(input()))
st = 4 
s = 'Yay!'
for i in range(4): 
    for j in range(st):
        if A[st] - A[st-1-j] > A[5]:
            s = ':('
    if s == ':(':
        break
    st -= 1
print(s)

Solution (Python):
a=[input() for i in range(5)]
k=int(input())
if int(a[4])-int(a[0]) <= k:
	print("Yay!")
else:
	print(":(")

Solution (Python):
anntena = [int(input()) for i in range(6)]
YES = ':('
NO = 'Yay!'
if anntena[-2] - anntena[0] > anntena[-1]:
    print(YES)
else:
    print(NO)

Solution (Python):
l = []
for i in range(5):
    a = int(input())
    l.append(a)
k = int(input())
l.sort()

if max(l) - min(l) > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
import sys
from itertools import permutations

a = [int(i) for i in sys.stdin]
b = list(permutations(a[:-1], 2))

for i, k in b:
  if a[-1] < abs(k - i):
    print(":(")
    break
else:
  print("Yay!")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e -a > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
inputs = [input() for i in range(6)]
k = int(inputs[5])
m = -1
for i in range(4):
    for j in range(i, 5):
        dist = int(inputs[i]) - int(inputs[j])
        if dist < 0:
            dist = - dist
        if dist > m:
            m = dist

if m > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if (e-a)> k:
    res=":("
else:
    res="Yay!"
print(res)

Solution (Python):
import itertools

input_list = []

for _ in range(5):
    a = int(input())
    input_list.append(a)

k = int(input())

c_list = list(itertools.combinations(input_list, 2))

ans_list = []
for i in c_list:
    
    ans = i[0] - i[1]
    ans = abs(ans)
    ans_list.append(ans)

for i in ans_list:
    if i > k:
        print(':(')
        exit()        
print('Yay!')

Solution (Python):

a = []
for i in range(6):
    a.append(int(input()))


f = 1

for j in range(len(a)-1):
    for k in range(1+j,5):



        if(a[k] - a[j] > a[5]):
            print(":(")
            f =  0
            break
    if(f ==0):
        break
if(f ==1):
    print("Yay!")

Solution (Python):
t = [int(input()) for i in range(5)] 
k = int(input())

c = t
have = False
for i in range(0,5):
    for j in range(0,5):
        if j != i:
            if abs(t[i] - c[j]) > k:
                have = True
    
if have:
    print(":(")
else:
    print("Yay!")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())


if(e-a>k):
	print(":(")
else:
	print("Yay!")

Solution (Python):
l = [0,0,0,0,0]
for i in range(5):
    l[i] = int(input())
k = int(input())
for i in range(5):
    for j in range(i,5):
        if abs(l[i] - l[j]) > k:
            print(":(")
            exit()

print("Yay!")

Solution (Python):
x = [int(input()) for _ in range(5)]
k = int(input())
if x[-1] - x[0] > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
li = []
for i in range(5):
    li.append(int(input()))

k = int(input())
li = sorted(li)
if k >= li[4] - li[0]:
    print("Yay!")
else:
    print(":(")

Solution (Python):
a,b,c,d,e,k=[int(input()) for i in range(6)]
if e-a <=k:
  print('Yay!')
else:
  print(':(')

Solution (Python):
input_list=[input() for i in range(6)]
antennas = [int(n) for n in input_list[0:5]]
k = int(input_list[5])

max_dist = max(antennas)-min(antennas)
if max_dist <= k:
    print("Yay!")
else:
    print(":(")

Solution (Python):
s = list(map(int,[input() for i in range(5)]))
k = int(input())
ans = "Yay!"
for i in s:
    for j in s:
        if abs(i-j) > k:
            ans = ":("
print(ans)

Solution (Python):
import sys
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
for x in a:
    for y in a:
        if abs(y-x) > k:
            print(':(')
            sys.exit()
print('Yay!')

Solution (Python):
ant = [int(input()) for i in range(5)]
k = int(input())

count = 0
for i in range(5):
    for j in range(0, i):
        if abs(ant[i] - ant[j]) > k:
            count += 1

if count > 0:
    print(":(")
else:
    print("Yay!")

Solution (Python):
l = [int(input()),int(input()),int(input()),int(input()),int(input())]
k = int(input())
i = 4
j = 0
y = 1
while i+1 :
  j = i-1
  while j+1 :
    if l[j-1]-l[i-1] > k : y = 0
    j -= 1
  i -= 1
if y == 1 : print('Yay!')
else : print(':(')

Solution (Python):
a = [int(input()) for i in range(5)]
k = int(input())
print('Yay!' if max(a) - min(a) <= k else ':(')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e-a) <= k:
  ans = "Yay!"
else :
  ans = ":("
 
print(ans)

Solution (Python):
antena=sorted([int(input()) for i in range(5)])
k = int(input())
print("Yay!" if antena[-1] - antena[0] <= k else ":(")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if all([abs(a-b)<=k,abs(a-c)<=k,abs(a-d)<=k,abs(a-e)<=k,abs(b-c)<=k,abs(b-d)<=k,abs(b-e)<=k,abs(c-d)<=k,abs(c-e)<=k,abs(d-e)<=k]):
    print('Yay!')
else:
    print(':(')

Solution (Python):
x = [0, 0, 0, 0, 0, 0]
i = 0
while(i<6):
    x[i] = int(input())
    i += 1

L = x[4] - x[0]
if(L <= x[5]):
    print('Yay!')
else:
    print(':(')

Solution (Python):
import copy


def main(input_nums):
    k = input_nums[5]
    nums = copy.deepcopy(input_nums)
    nums.pop(5)

    for i_a, num_a in enumerate(nums):
        for i_b, num_b in enumerate(nums):
            if i_a != i_b:
                if abs(num_a - num_b) > k:
                    return ":("

    return "Yay!"


if __name__ == "__main__":
    input_nums = []
    for _ in range(6):
        input_nums.append(int(input()))
    print(main(input_nums))

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
l = [int(input()) for i in range(5)]
k = int(input())
c = 0
for i in range(5):
    for j in range(5):
        if abs(l[i] - l[j]) > k:
            c += 1
    
if c == 0:
    print('Yay!')
else:
    print(':(')

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
k = int(input())

l = [A, B, C, D, E]

for i in range(5):
    for j in range(i, 5):
        if abs(l[i] - l[j]) > k:
            print(":(")
            exit()

print("Yay!")

Solution (Python):
antena = [int(input()) for i in range(5)]
K = int(input())
for i in range(5):
  for j in range(i, 5):
    if (abs(antena[i] - antena[j])) > K:
      print(':(')
      exit()
print('Yay!')

Solution (Python):
antenas = [int(input()) for i in range(5)]
distance = int(input())
res = "Yay!"

for i in range(len(antenas)):
  for j in range(i + 1, len(antenas)):
    if antenas[j] - antenas[i] > distance:
      res = ":("
      break

print(res)

Solution (Python):
x = []
for i in range(5):
    x.append(input())

k = input()

ans = True
for i in range(4):
    for j in range(i+1, 5):
        if k < x[j] - x[i]:
            ans = False

if ans:
    print("Yay!")
else:
    print(":(")

Solution (Python):

d=[]
for i in range(5):
    d.append(int(input()))
k=int(input())

for i in range(5):
    for j in range(5):
        if abs(d[i]-d[j]>k):
            print(':(')
            exit()
print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e-a <= k:
  print("Yay!")
else:
  print(":(")

Solution (Python):
a = int(input().strip())
b = int(input().strip())
c = int(input().strip())
d = int(input().strip())
e = int(input().strip())
k = int(input().strip())


if (e-a >k ) : print(":(")
else : print("Yay!")

Solution (Python):


li = []
for i in range(5):
    li.append(int(input()))
k = int(input())

yay_flag = True
for i, f in enumerate(li):
    for j, g in enumerate(li):
        if abs(li[j] - li[i]) > k:
            print(':(')
            yay_flag = False
            break
    else:
        continue
    break
if yay_flag:
    print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

longth = [a, b, c, d, e]

for i in range(4):
    if longth[i+1] - longth[0] <= k:
        continue
    else:
        print(':(')
        break
else:
    print('Yay!')

Solution (Python):
d = [0]*5
for i in range(5):
    d[i] = int(input())
k = int(input())
ng = 0
for i in range(4,-1,-1):
    for j in range(i-1,-1,-1):
        if( d[i] - d[j] > k ):
            ng = 1
if( ng == 1 ):
    print(":(")
else:
    print("Yay!")

Solution (Python):
minpos = int(input())

for _ in range(3):
    _ = input()

maxpos = int(input())
k = int(input())

if maxpos - minpos <= k:
    print("Yay!")
else:
    print(":(")

Solution (Python):

list = [int(input()) for i in range(5)]
k = int(input())
n=False

for i in range(5):
    for j in range(5):
        if(abs(list[i] - list[j]) > k):
            print(":(")
            n=True
            break
    if n:
        break

if not n:
    print("Yay!")

Solution (Python):
list=[int(input()) for i in range(6)]

for f in range(5):
    for l in range(4):
        if list[l+1] - list[f] > list[-1]:
            print(':(')
            break
    else:
        continue
    break
else:
    print('Yay!')

Solution (Python):


p = [int(input()) for _ in range(5)]
k = int(input())
print(":(" if max(p) - min(p) > k else "Yay!")

Solution (Python):
import numpy as np


a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

antennas = np.array([a, b, c, d, e])
xx0, xx1 = np.meshgrid(antennas, antennas)

distance = np.abs(xx0 - xx1)

if np.all(distance <= k):
    print('Yay!')
else:
    print(':(')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print("Yay!")
else:
    print(":(")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
d_x = e - a 

if d_x <= k:
    print('Yay!')
else:
    print(':(')

Solution (Python):
aa = [int(input()) for _ in range(5)]
k = int(input())
if max(aa) - min(aa) > k:
    print(':(')
else:
    print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [b-a,c-a,d-a,e-a,c-b,d-b,e-b,d-c,e-c,e-d]
if max(l) <= k:
    print('Yay!')
else:
    print(':(')

Solution (Python):
import sys
p = [int(input()) for i in range(5)]
k = int(input())
for i in p:
    for j in range(4):
        if abs(i - p[j]) > k:
            print(":(")
            sys.exit()
print("Yay!")

Solution (Python):
A = []

for i in range(6):
    A.append(int(input()))

if max(A) - min(A) >= A[5] + 1:
    print(":(")

else:
    print("Yay!")

Solution (Python):
a = []
f = 1
for i in range(6):
    a.append(int(input()))
amax = max(a)
amin = min(a)
for i in range(5):
    if abs(amax - a[i]) <= a[-1] and abs(a[i] - amin) <= a[-1]:
        continue
    else:
        f = 0
if f:
    print("Yay!")
else:
    print(":(")

Solution (Python):
antenna = []
for i in range(5):
   antenna.append(int(input()))
k = int(input())
ifd = 0
for i in range(5): 
   for j in range(5):
      if((antenna[i] - antenna[j]) > k):ifd = 1
if(ifd == 0): print("Yay!")
else: print(":(")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a>k:
    print(':(')
else:
    print('Yay!')

Solution (Python):
a = []
for i in range(5):
  a.append(int(input()))
k = int(input())

if a[4] - a[0] <= k:
  print("Yay!")
else:
  print(":(")

Solution (Python):
a = [0,0,0,0,0,0]

a[0] = int(input())
a[1] = int(input())
a[2] = int(input())
a[3] = int(input())
a[4] = int(input())
a[5] = int(input())

for x in range(5):
	for y in range(5):
		if x != y:
			if abs(a[x]-a[y])>a[5]:
				print(":(")
				exit()
print("Yay!")

Solution (Python):
max_distance = 0
previous = int(input())
for i in range(4):
    current = int(input())
    distance = current - previous
    if distance > max_distance:
        max_distance = distance

k = int(input())

if max_distance > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
l = []
for i in range(6):
    l.append(int(input()))

print(":(") if l[-2]-l[0]>l[-1] else print("Yay!")

Solution (Python):
wk = []
for i in range(5):
  wk.append(int(input()))
limit = int(input())

if max(wk) - min(wk) > limit:
  print(':(')
else:
  print('Yay!')

Solution (Python):
l = [int(input()) for _ in range(5)]
k = int(input())
a = max(l) - min(l)
if a > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):



a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())


k = int(input())


max_dis = e -a
        

if max_dis <= k:
  print('Yay!')
else:
    print(':(')

Solution (Python):
in_list = []
for i in range(5):
  in_list.append(int(input()))
if max(in_list) - min(in_list) > int(input()):
  print(":(")
else:
  print("Yay!")

Solution (Python):
A=[int(input()) for i in range(5)]
k=int(input())
delta=max(A)-min(A)
if delta<=k:
    print("Yay!")
else:
    print(":(")

Solution (Python):
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
ans = 0

for i in range(5):
    for j in range(5):
        if i == j: continue
        if abs(a[i] - a[j]) > k:
            ans += 1
print(':(' if ans > 0 else 'Yay!')

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

def ng(x,y):
  return (y-x)>k

if ng(a,b) or ng(a,c) or ng(a,d) or ng(a,e) or ng(b,c) or ng(b,d) or ng(b,e) or ng(c,d)or ng(c,e) or ng(d,e):
  print(":(")
else:
  print("Yay!")

Solution (Python):
point = [int(input()) for i in range(5)]
k = int(input())
if point[-1] - point[0] > k:
  print(":(")
else:
  print("Yay!")

Solution (Python):
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
biggestdiff = int(a) - int(e)
biggestdiff = -biggestdiff
if biggestdiff <= int(k):
  print("Yay!")
else:
  print(":(")

Solution (Python):
a=[int(input()) for i in range(6)]
print("Yay!" if a[4]-a[0]<=a[5] else ":(")

Solution (Python):
A = []
for i in range(5):
  A.append(int(input()))
K = int(input())
A.sort()
print(":(" if A[4] - A[0] > K else "Yay!")

Solution (Python):


import sys
import itertools

INF = float('inf')
MOD = 10 ** 9 + 7

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 LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    A = [II() for _ in range(5)]
    k = II()

    judge = True
    for x, y in itertools.combinations(A, 2):
        if y - x > k:
            judge = False
            break

    return 'Yay!' if judge else ':('


print(main())

Solution (Python):
anntena_list = []
 
for i in range(5):
    anntena_list.append(int(input()))
    
m = int(input())
    
flag = False
for i in range(4):
  for j in range(3-i):
    if anntena_list[4-i] - anntena_list[j]  > m:
      flag = True
      
if flag:
  print(':(')
else:
  print('Yay!')

Solution (Python):
arr=[]
for i in range(5):
    arr.append(int(input()))
k=int(input())

if max(arr) - min(arr) > k:
    print(':(')
else:
    print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())


def main():
    if abs(a-b) > k:
        return ":("
    if abs(a-c) > k:
        return ":("
    if abs(a-d) > k:
        return ":("
    if abs(a-e) > k:
        return ":("
    if abs(b-c) > k:
        return ":("
    if abs(b-d) > k:
        return ":("
    if abs(b-e) > k:
        return ":("
    if abs(c-d) > k:
        return ":("
    if abs(c-e) > k:
        return ":("
    if abs(d-e) > k:
        return ":("
    return "Yay!"


print(main())

Solution (Python):

A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
k=int(input())

if E-A>k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
num_list = []
while True:
    try:
        element = input()
    except EOFError:
        break

    num_list.append(int(element))

limit = num_list[-1]

ans_string = "Yay!"





for i in range(len(num_list) - 1):
    for j in range(i, len(num_list) - 1):
        if num_list[j] - num_list[i] > limit:
            ans_string = ":("

print(ans_string)

Solution (Python):
a, b, c, d, e, k = [input() for _ in range(6)]

if int(e) - int(a) > int(k):
    print(':(')
else:
    print('Yay!')

Solution (Python):
a= int(input())
b= int(input())
c= int(input())
d= int(input())
e= int(input())
k= int(input())

if(e-a > k):
  print(":(")
else:
  print("Yay!")

Solution (Python):
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


A = read_col(5, 1)[0]

k = read_a_int()

if A[-1] - A[0] > k:
    print(':(')
else:
    print('Yay!')

Solution (Python):

list = []
for i in range(6):
    a = int(input())
    list.append(a)

flag = False
for i in range(5):
    for j in range(i+1, 5):
        if list[j] - list[i] > list[5]:
            flag = True

if flag:
    print(':(')
else:
    print('Yay!')

Solution (Python):
a = []
for i in range(6):
  po = int(input())
  a.append(po)
           
flag = 0
count = 0
for i in range(5):
  for j in range(4-i):
    sa = abs(a[i]-a[i+j+1])
    count = count + 1
    if sa > a[5]:
      flag = 1
      break

if flag == 0:
  print("Yay!")
else:
  print(":(")

Solution (Python):

li=[0]*6

for i in range(6):

  li[i]=int(input())

  

if li[4]-li[0]>li[5]:

  print(":(")

else:
  print("Yay!")

Solution (Python):
p = [int(input()) for i in range(5)]
k = int(input())

if(p[4] - p[0] > k):
	print(":(")
else:
	print("Yay!")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
g=0
if b-a>k or c-b>k or d-c>k or e-d>k or c-a>k or d-a>k or e-a>k or d-b>k or e-b>k or e-c>k: 
  g=1

if g==0: 
  print("Yay!")
elif g==1:
  print(":(")

Solution (Python):
a = []
for i in range(6):
    a.append(input())
maxn = 0
minn = 128
for i in range(5):
	if(maxn < a[i]):
		maxn = a[i]
	if(minn > a[i]):
		minn = a[i]
if(maxn - minn > a[5]):
	print(":(")
else:
	print("Yay!")

Solution (Python):
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()

A = int(a)
B = int(b)
C = int(c)
D = int(d)
E = int(e)
K = int(k)

if E-A > K:
    print(":(")
else:
    print("Yay!")

Solution (Python):
a = list()
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
k = int(input())

result = True
for i in range(len(a)):
    for j in range(i+1, len(a)):
        
        if a[j] - a[i] > k:
            result = False

if result:
    print('Yay!')
else:
    print(':(')

Solution (Python):
X = [0]*6
for i in range(6):
    X[i] = int(input())

for a in X:
    for b in X:
        if abs(a - b) > X[-1]:
            print(":(")
            quit()

print("Yay!")

Solution (Python):

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:
  print(':(')
else:
  print('Yay!')

Solution (Python):
import sys

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
date = {a, b, c, d, e}
for h in date:
    for i in date:
        if int(abs(h - i)) > k:
            print(':(')
            sys.exit()

print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
  print('Yay!')
else:
  print(':(')

Solution (Python):
import sys
input = sys.stdin.readline
a, b, c, d, e, k = (int(input()) for i in range(6))
list, ans = [a, b, c, d, e], 'Yay!'
for i in range(4):
    for j in range(i, 5):
        if list[j] - list[i] > k:
            ans = ':('
            break
print(ans)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

list_ = [a,b,c,d,e,k]
flag = False
for factor_1 in list_:
  for factor_2 in list_:
    if abs(factor_1 - factor_2) > k:
      flag = True
    else:
      continue
if flag == True:
  print( ":(" )
else:
  print("Yay!")

Solution (Python):

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
li = [int(input()) for _ in range(5)]
k = int(input())

maxDif = max(li) - min(li)
if maxDif <= k:
  print('Yay!')
else:
  print(':(')

Solution (Python):
from sys import stdin

def main():
    I = [int(input()) for _ in [0] * 6]

    if I[4] - I[0] > I[5]:
        print(':(')
    else:
        print('Yay!')

input = lambda: stdin.readline().rstrip()
main()

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a > k:
  print(":(")
else:
  print("Yay!")

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
print "Yay!" if e - a <= k else ":("

Solution (Python):
import sys
from itertools import combinations


def main():
    input = sys.stdin.readline
    antena_list = [int(input()) for _ in range(5)]
    k = int(input())
    max_length = max([j - i for i, j in combinations(antena_list, 2)])
    print(":(" if max_length > k else "Yay!")


if __name__ == "__main__":
    main()

Solution (Python):
a = [int(input()) for _ in range(5)]
k = int(input())
if (a[-1] - a[0]) <= k:
    print('Yay!')
else:
    print(':(')

Solution (Python):
a = int(input())
smallest = a
largest = a
for i in range(4):
    a = int(input())
    if a<smallest:
        smallest = a
    elif a>largest:
        largest = a
k = int(input())
if largest - smallest > k:
    print(':(')
else:
    print('Yay!')

Solution (Python):
a=[int(input()) for i in range(5)]
k=int(input())
s=0
for i in range (4):
	if a[4]-a[i]>k:
		s+=1
	else:
		s+=0
for i in range (3):
	if a[3]-a[i]>k:
		s+=1
	else:
		s+=0
for i in range (2):
	if a[2]-a[i]>k:
		s+=1
	else:
		s+=0
if a[1]-a[0]>k:
		s+=1
else:
		s+=0
if s==0:
	print("Yay!")
else:
	print(":(")

Solution (Python):
def getResult(pos, K) :
    for i in range(len(pos)-1) :
        for j in pos[i+1:] :
            if abs(pos[i] - j) > K :
                return ":("
    return "Yay!"

position = []
for i in range(5) :
    position.append(int(input()))
k = int(input())
print(getResult(position, k))

Solution (Python):
a = [0,0,0,0,0]
a[0] = int(input())
a[1] = int(input())
a[2] = int(input())
a[3] = int(input())
a[4] = int(input())
k = int(input())

re = 'Yay!'
for i in range(5):
    for j in range(5):
        if i != j:
            if abs(a[i] - a[j]) > k:
                re = ':('
                break
                
print(re)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if e-a>k:
  print(":(")
else:
  print("Yay!")

Solution (Python):
x = []
for i in range(5):
    x.append(int(input()))
             

k = int(input())
if x[4]-x[0] <= k:
    print("Yay!")
else :
    print(":(")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

l = [a,b,c,d,e]
l2 = sorted(l)
if k >= l2[4]-l2[0]:
    print('Yay!')
else:
    print(':(')

Solution (Python):
import sys
set=[int(input()) for x in range(6)]
ante=set.pop(-1)

for x in set:
    for y in set:
        if x<=y:
            if ante<y-x:
                print(':(')
                sys.exit()

print("Yay!")

Solution (Python):
a = [int(input()) for i in range(6)]
b = a.pop(-1)
for i in a:
    for j in a:
        if j - i > b:
            print(":(")
            exit()

print("Yay!")

Solution (Python):
a = []

for i in range(6):
    a.append(int(input() )) 

f = True
for i  in range(4):
    for j in range(4-i):
        if a[j + i + 1]  - a[i] > a[5]:
            f = False
            break

if f:
    print("Yay!")
else:
    print(":(")

Solution (Python):
import sys
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
diff = int(input())

if diff >= e-a:
    print("Yay!")
else:
    print(":(")

Solution (Python):
a, b, c, d, e = [int(input()) for _ in range(5)]
k = int(input())

max_distance = e - a
if max_distance > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
ans = 'Yay!'
if b - a > k:
    ans = ':('
if c - a > k:
    ans = ':('
if d - a > k:
    ans = ':('
if e - a > k:
    ans = ':('
if c - b > k:
    ans = ':('
if d - b > k:
    ans = ':('
if e - b > k:
    ans = ':('
if d - c > k:
    ans = ':('
if e - c > k:
    ans = ':('
if e - d > k:
    ans = ':('
print(ans)

Solution (Python):

l = []

for i in range(5):
    b = int(input())
    l.append(b)

k = int(input())

a = []
for i in range(4):
    for j in range(i+1,5):
        ans = l[j]-l[i]
        a.append(ans)

b = 0

for i in range(10):
    if a[i]>k:
        b = 1
        break

if b == 1:
    print(':(')
elif b == 0:
    print('Yay!')

Solution (Python):
A=[int(input()) for _ in range(5)]
k=int(input())
print('Yay!' if A[4]-A[0]<=k else ':(')

Solution (Python):
def finder(antena,k):
    A = antena[0]
    notAs = antena[1:]
    for notA in notAs:
        if (notA-A)>k:
            return print(':(')
        
        elif len(notAs)==2:
            return print('Yay!')
    return finder(notAs,k)

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

antena = [a,b,c,d,e]

finder(antena,k)

Solution (Python):


antenna = [int(input()) for _ in range(5)]
k = int(input())

possible = True
for i in range(5):
    for j in range(i + 1, 5):
        if antenna[j] - antenna[i] > k:
            possible = False

print("Yay!" if possible else ":(")