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):
import sys
input = sys.stdin.readline
def print_ans(ar, k):
    """Test Case
    >>> print_ans([1, 2, 4, 8, 9], 15)
    Yay!
    >>> print_ans([15,18,26,35,36],18)
    :(
    """
    flg = False
    for i in range(4):
        for j in range(i+1,5):
            if ar[j] -ar[i] > k:
                flg = True
                break
        if flg:
            break
    if flg:
        print(":(")
    else:
        print("Yay!")


if __name__ == '__main__':
    ar = [ int(input().rstrip()) for _ in range(5)]
    k = int(input().rstrip())
    print_ans(ar, k)

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

for i in range(6):
  array[i] = int(input())

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
dis =[]
dis.append(a)
dis.append(b)
dis.append(c)
dis.append(d)
dis.append(e)

if max(dis)-min(dis)>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())
S=[a,b,c,d,e]
ans="Yay!"
for i in S:
    for j in S:
        if abs(i-j)<=k:
            pass
        else:
            ans=":("
            break
print(ans)

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):
abcde =[ int(input()) for _ in range(5)] 
K = int(input())
flag = False
for i in range(5):
    for s in range(1,5-i):
        if abcde[s] - abcde[i] > K:
            flag = True
if flag:
    print(':(')
else:
    print('Yay!')

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

for i in range(5):
  for j in range(i+1, 5):
    if abs(num[i]-num[j]) > k:
      print(':(')
      exit(0)

print('Yay!')

Solution (Python):
import sys

def main():
    *antennas, k = map(int, sys.stdin.read().split())
    if antennas[-1] - antennas[0] > k:
            print(':(')
            sys.exit()
    print('Yay!')

if __name__ == "__main__":
    main()

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

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

maxi = max(a,b,c,d,e)
mini = min(a,b,c,d,e)
diff = maxi - mini
if diff <= k:
    print("Yay!")
else:
    print(":(")

Solution (Python):
import itertools
anthena = [int(input())for _ in range(5)]
k = int(input())
ans = "Yay!"
for i,j in itertools.combinations(anthena,2):
  if abs(i - j) > k:
    ans = ":("
print(ans)

Solution (Python):
loc = [0]*5
loc = [int(input()) for i in range(len(loc))]
k = int(input())
if max(loc) -min(loc) > k:
    print(':(')
else:        
    print('Yay!')

Solution (Python):

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

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

Solution (Python):
import sys
A = []
for _ in range(5):
    A.append(int(input()))
k = int(input())
for i in range(4):
    for j in range(i + 1, 5):
        if A[j] - A[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(":(")
else:
    print("Yay!")

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    l=[int(input()) for i in range(5)]
    k=int(input())
    f=True
    for i in l:
        for j in l:
            if abs(i-j) >k:
                f=False      
    print('Yay!' if f == True else ':(')

if __name__ == '__main__':
    main()

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

Solution (Python):
A = [int(input()) for i in range(5)]
k = int(input())
ans = 'Yay!'
if A[4] - A[0] > k:
    ans = ':('

print(ans)

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 = []
for i in range(6):
   l.append(int(input()))

if l[4]-l[0]>l[5]:
    print(":(")
else:
    print("Yay!")

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

Solution (Python):
a,*_,e,k=map(int,open(0))
print([":(","Yay!"][e-a<=k])

Solution (Python):
l=list(int(input()) for _ in range(5))
m=int(input())
print([":(","Yay!"][l[4]-l[0]<=m])

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



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

print('Yay!')

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



for i in range(5):
  for j in range(5):
    if abs(l[i] - l[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 b - a > k:
    print(":(")
elif c - a > k:
    print(":(")
elif d - a > k:
    print(":(")
elif e - a > k:
    print(":(")
elif c - b > k:
    print(":(")
elif d - b > k:
    print(":(")
elif e - b > k:
    print(":(")
elif d - c > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > 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())

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

for i in antena:
    for j in antena:
        if abs(i - j) <= k:
            count += 1

if count == 25:
    print("Yay!")
else:
    print(":(")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
nums = [a, b, c, d, e]
ans = 'Yay!'
for i in range(0, 5):
    for j in range(0, 5):
        src = abs(nums[i] - nums[j])
        if src > k:
            ans = ':('
print(ans)

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

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

Solution (Python):
at = [int(input()) for x in range(5)]
k = int(input())

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

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

Solution (Python):
a = [int(input()) for _ in range(6)]
if a[4]-a[0] <= a[5]:
    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=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if max(k,b-a,c-a,d-a,e-a,c-b,d-b,e-b,d-c,e-c,e-d)==k:
  print("Yay!")
else:
  print(":(")

Solution (Python):
A = [int(input()) for i in range(5)]
k = int(input())
ans = 0
for i in range(5):
    for x in range(i,5):
        if A[x] - A[i] > k:
            ans = ans + 1
if ans > 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())
if b-a > k or c-a > k or d-a > k or e-a > k or e-d > k or e-c > k or e-b > k or 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())

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

Solution (Python):
a,b,c,d,e,k=[int(input()) for i in range(6)]
if abs(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())
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())
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)]
a,c=min(l),max(l)
k=int(input())
print("Yay!") if (a-c)**2<=k**2 else print(":(")

Solution (Python):

import sys










def main():
    *antennas, k = [int(x) for x in sys.stdin.read().split()]
    if antennas[-1] - antennas[0] > k:
            print(':(')
            sys.exit()
    print('Yay!')

if __name__ == "__main__":
    main()

Solution (Python):
a = []
for i in range(6):
    a.append(int(input()))
if(a[4] - a[0]<=a[5]):
    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())

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

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

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

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

if al[-1] - al[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())

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

Solution (Python):
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))
ans=0
for j in range(0,4):
  for k in range(j+1,5):
    if a[k]-a[j]>a[5]:
      ans+=1
    
if ans==0:
  print("Yay!")
else:
  print(":(")

Solution (Python):
lists=[]
for i in range(5):
  nums=int(input())
  lists.append(nums)
dis=int(input())
lists=sorted(lists)
if lists[-1]-lists[0]<=dis:
  print("Yay!")
else:
  print(":(")

Solution (Python):
a=[0]*5
for i in range(5):
  a[i]=int(input())
k=int(input())
suc=True

for i in range(4):
  for j in range(i+1,5):
    if a[j]-a[i]>k:
      suc=False
      
if suc:
  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:
  ret = ":("
else:
  ret = "Yay!"

print(ret)

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):
d=[int(input()) for i in range(5)]
k=int(input())
count=0

for i in d:
  for j in d:
    if abs(i-j)>k:
      count=1

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

Solution (Python):
ls = [int(input()) for _ in range(6)]

if ls[4] - ls[0] > ls[5]:
    print(":(")
else:
    print("Yay!")

Solution (Python):
def check_num():
  if b-a > k or c-a > k or d-a > k or e-a > k or c-b > k or d-b > k or e-b > k or d-c > k or e-c > k or e-d > k:
    print(":(")
  else:
    print("Yay!")


a, b, c, d, e, k = [int(input()) for _ in range(6)]
check_num()

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

check = 0

for i in moji_list:
  for j in moji_list:
    if abs(i-j) > k:
      check = 1
      
if check == 0:
  print("Yay!")
else:
  print(":(")

Solution (Python):

import sys

a, b, c, d, e, k = [int(input()) for _ in range(6)]
can_directly = True

for i in [a, b, c, d, e]:
    for j in [a, b, c, d, e]:
        if j - i > k:
            can_directly = False

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

Solution (Python):
from itertools import combinations

l = [int(input()) for i in range(6)]
k = l.pop()
if any(abs(i[0]-i[1])>k for i in combinations(l,2)):
    print(":(")
else:
    print("Yay!")

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

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

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

Solution (Python):
p=[]
for i in range(5):
  p+=[int(input())]
k = int(input())
if p[-1]-p[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())
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):
array = [];
ans = 0;

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

if abs(array[0] - array[1]) > array[5]: ans += 1;
if abs(array[0] - array[2]) > array[5]: ans += 1;
if abs(array[0] - array[3]) > array[5]: ans += 1;
if abs(array[0] - array[4]) > array[5]: ans += 1;

if abs(array[1] - array[2]) > array[5]: ans += 1;
if abs(array[1] - array[3]) > array[5]: ans += 1;
if abs(array[1] - array[4]) > array[5]: ans += 1;

if abs(array[2] - array[3]) > array[5]: ans += 1;
if abs(array[2] - array[4]) > array[5]: ans += 1;

if abs(array[3] - array[4]) > array[5]: ans += 1;

if ans == 0: 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, b, c, d, e, k = [int(input()) for i in range(6)]


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

Solution (Python):
def main():
    array = [int(input()) for _ in range(6)]
    k = array[-1]
    array = array[:-1]

    minimum = min(array)
    maximum = max(array)
    if maximum-minimum > k:
        print(':(')
        return
    print('Yay!')


if __name__ == '__main__':
    main()

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

Solution (Python):
from sys import stdin

li = [int(stdin.readline().rstrip()) for _ in range(5)]
k = int(stdin.readline().rstrip())

from itertools import combinations
lin = list(combinations(li, 2))

for i in range(len(lin)):
    if abs(lin[i][0]-lin[i][1]) > k:
        print(":(")
        exit()

print("Yay!")

Solution (Python):
l = []
ans = 'Yay!'
for i in range(5):
  l.append(int(input()))
k = int(input())
for i in range(4):
  for j in range(i+1, 5):
    if abs(l[i] - l[j]) > k:
      ans = ':('
print(ans)

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

if k < list1[-1] - list1[0]:
    print(":(")
else:
    print("Yay!")

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

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

k = int(input())

flag = True
for i in range(5):
  for j in range(i+1, 5):
    dist = ass[j] - ass[i]
    if dist > k:
      flag = False
      
if flag:
  print('Yay!')
else:
  print(':(')

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ant_list=[a,b,c,d,e]
ant_list.sort()
if (ant_list[-1]-ant_list[0])<=k:
    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):
l=[int(input()) for i in range(5)]
k=int(input())

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

print('Yay!')

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

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

k = int(input())

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

Solution (Python):
a=int(input(""))
b=int(input(""))
c=int(input(""))
d=int(input(""))
e=int(input(""))
k=int(input(""))
M=max(a,b,c,d,e)
m=min(a,b,c,d,e)
sa=M-m
if sa<=k:
    print('Yay!')
else:
    print(':(')

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

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

k=int(input())

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

Solution (Python):
li=[]
for n in range(5):
    li.append(int(input()))
li.sort()
k=int(input())
if li[4]-li[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())

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

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

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

Solution (Python):
a = [int(input()) for i in range(5)]
k = int(input())
for i in range(4):
   if a[4] - a[i] > k:
      print(':(')
      exit()
print('Yay!')

Solution (Python):
A=[]
for i in range(5):
    A.append(int(input()))
k=int(input())
ans='Yay!'
for j in range(5):
    for l in range(j,5):
        if abs(A[j]-A[l])>k:
            ans=':('
print(ans)

Solution (Python):
X = [int(input()) for _ in range(6)]

x = X[4] - X[0]

if x > X[5]:
    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):
lst = [int(input()) for _ in range(5)]
k = int(input())
ans = True
for i in range(4):
    for j in range(1, 5):
        if (lst[j]-lst[i] > k):
            ans = False
print('Yay!' if ans else ':(')

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

for i in range(5):
	for j in range(i, 5):
		if inp[j] - inp[i] > k:
			print(":(")
			exit(0)
print("Yay!")

Solution (Python):


def main():
    antenas = [int(input()) for i in range(5)]
    k = int(input())

    for antena in antenas:
        for antena2 in antenas:
            if (antena - antena2)>k:
                print(':(')
                return

    print('Yay!')


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
x = max(a,b,c,d,e) - min(a,b,c,d,e)

if k >= x:
  print("Yay!")
else:
  print(":(")

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

k = int(input())
ans = max(diff_L)-min(diff_L)

if ans <= 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())

N = [a, b, c, d, e, k]

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

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

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

Solution (Python):
a = []
for _ in range(5):
    a.append(int(input()))
k = int(input())
for i in range(5):
    for j in a[i+1:]:
        if abs(a[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())
ans1 = ("Yay!")
ans2 = (":(")
if e - a <= k:
    print(ans1)
else:
    print(ans2)

Solution (Python):
s = []

for i in range(5):
    s.append(int(input()))
    
k = int(input())

s.sort()

if s[4] - s[0] <= k:
    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):
l=[]
count=0
for i in range(5):
	l.append(int(input()))
k=int(input())

if l[4]-l[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())

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

Solution (Python):
list = []
for n in range(5):
  list.append(int(input()))
list.sort()

if abs(list[0]-list[-1]) > int(input()):
  print(':(')
else:
  print('Yay!')

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

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

if a[4]-a[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())
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())
if b-a<=k and c-b<=k and d-c<=k and e-d<=k and c-a<=k and d-a<=k and e-a<=k and d-b<=k and e-b<=k and e-c<=k:
    print('Yay! ')
else:
    print(':(')

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    a = [int(input().rstrip('\n')) for _ in range(5)]
    k = int(input().rstrip('\n'))
    a.sort()
    print("Yay!" if abs(a[0] - a[-1]) <= k else ":(")


if __name__ == '__main__':
    slove()

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):
x = [int(input()) for _ in range(5)]
k = int(input())
if max(x) - min(x) > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
n = []

for i in range(0,5) :
    n.append(int(input()))

k = int(input())

count = 0

for p in range(0, 4) :
    for q in range(p + 1, 5) :
        if n[q] - n[p] > k :
            print(':(')
            exit()

print('Yay!')

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

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

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

Solution (Python):
import sys

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

gap = [abs(a-e),abs(b-e),abs(c-e),abs(d-e)]

for i in range(len(gap)):
	if gap[i] > k:
		print(':(')
		sys.exit()
print('Yay!')

Solution (Python):
import sys

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

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

gap = [abs(a-e),abs(b-e),abs(c-e),abs(d-e)]

for i in range(len(gap)):
	if gap[i] > k:
		print(':(')
		sys.exit()
print('Yay!')

Solution (Python):
antenna = [int(input()) for i in range(5)]
k = int(input())
ans = "Yay!"

if max(antenna)-min(antenna) > k:
    print(":(")
else:
    for i in range(len(antenna)):
        for j in range(len(antenna)):
            if abs(antenna[i]-antenna[j]) > k:
                ans = ":("
    print(ans)

Solution (Python):
*a,k=[int(input()) for _ in range(6)]
print("Yay!" if max(a)-min(a)<=k else ":(")

Solution (Python):
from itertools import combinations
antena = [int(input()) for _ in range(5)]
k = int(input())
ans = True
for cmb in combinations(antena, 2):
    ans &= abs(cmb[0]-cmb[1])<=k
if ans:
    print('Yay!')
else:
    print(':(')

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

a=INPUT[0]
e=INPUT[4]
k=INPUT[5]

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

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

Solution (Python):
def slove():
    import sys
    import itertools
    input = sys.stdin.readline
    ae = [int(input().rstrip('\n')) for _ in range(5)]
    k = int(input().rstrip('\n'))
    for v in itertools.combinations(ae, 2):
        i, j = v
        if abs(i - j) > k:
            print(":(")
            exit()
    print("Yay!")


if __name__ == '__main__':
    slove()

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

Solution (Python):
'''A - Five Antennas
https://atcoder.jp/contests/abc123/tasks/abc123_a

>>> main([1, 2, 4, 8, 9], 15)
Yay!
>>> main([15, 18, 26, 35, 36], 18)
:(

in1.txt
>>> main([0, 7, 9, 52, 123], 123)
Yay!'''

from itertools import permutations


def main(_input, k):
    for p in permutations(_input, 2):
        if p[0] - p[1] > k:
            print(':(')
            return

    print('Yay!')


if __name__ == "__main__":
    _input = []

    for _ in range(5):
        _input.append(int(input()))

    k = int(input())

    main(_input, k)

Solution (Python):
l =[]
for i in range(6):
  a =int(input())
  l.append(a)
if l[-2] - l[0] > l[-1]:
  print(':(')
else:
  print('Yay!')

Solution (Python):
import sys
lst=[0]*6
for i in range(6):
  lst[i]=int(input())
k=lst[-1]
for i in range(4):
  for j in range(i+1,5):
    if abs(lst[i]-lst[j])>k:
      print(':(')
      sys.exit()
print('Yay!')

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

Solution (Python):




antn = list(map(int, open(0).read().split()))
flg = 0
for i in range(0,4):

    j=0
    for j in range(i+1, 5):
        if (antn[j] - antn[i] > antn[5]):
            flg = 1
print("Yay!" if flg == 0 else ":(")

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
for x in [a, b, c, d, e]:
    for y in [a, b, c, d, e]:
        if x != y:
            if k < abs(x - y):
                print(":(")
                exit()
print("Yay!")

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

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

Solution (Python):
s = [int(input()) for i in range(6)]
diff = s[4]-s[0]
k = s[5]

if diff > k:
  print(':(')
elif diff <= k:
  print('Yay!')

Solution (Python):
ant = [int(input()) for _ in range(6)]
ans = "Yay!"
for i in range(len(ant) - 1):
    for j in range(i + 1, len(ant)):
        if abs(ant[i] - ant[j]) > ant[-1]:
            ans = ":("
            break
print(ans)

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())
if e - a <= k:
         print("Yay!")
else:
         print(":(")

Solution (Python):
from itertools import combinations
inputs = [int(input()), int(input()), int(input()), int(input()), int(input())]
K=int(input())
print('Yay!' if all([1 if abs(cmb[0]-cmb[1]) <= K else 0 for cmb in combinations(inputs,2)]) else ':(')

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

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

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):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [e, d, c, b, a]
for i in range(len(l)-1):
  for j in range(len(l)):
    if l[i]-l[j] > k:
      print(":(")
      quit()
print("Yay!")

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

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

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

Solution (Python):
from sys import exit
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
coordinates = [a, b, c, d, e]
for i in range(5):
    for j in range(i + 1, 5):
        if coordinates[j] - coordinates[i] > 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 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,b,c,d,e,k=[int(input()) for i in range(6)]
print("Yay!" if e-a<=k else ":(")

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

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

Solution (Python):
A = [int(input()) for i in range(5)]
k = int (input())
max_dis = max([abs(A[i] - A[j]) for i in range(5) for j in range(i+1, 5)])
print(":(") if max_dis > k else print("Yay!")

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

Solution (Python):
a,*_,e,k=map(int,open(0).read().split());print("Y:a(y !"[e-a>k::2])

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

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

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

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

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

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