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):


def main():
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    flag = True

    if b-a > k:
        flag = False
    elif c-a > k:
        flag = False
    elif d-a > k:
        flag = False
    elif e-a > k:
        flag = False
    elif c-b > k:
        flag = False
    elif d-b > k:
        flag = False
    elif e-b > k:
        flag = False
    elif d-c > k:
        flag = False
    elif e-c > k:
        flag = False
    elif d-e > k:
        flag = False

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


if __name__ == "__main__":
    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:
  ans = 'Yay!'
else:
  ans = ':('
print(ans)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
dis = e - a
if dis <= 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=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 = [0]*6
for i in range(6):
  A[i] = 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(':(')
else:
    print('Yay!')

Solution (Python):
import itertools
cnt=0
z=[]
for n in range(5):
    z.append(int(input()))
k = int(input())
c= list(itertools.combinations(z,2))
for i in c:
    temp = list(i)
    if temp[1]-temp[0]<=k:
        cnt+=1
if cnt==10:
    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())

A=[a,b,c,d,e]
count=0
for i in range(5):
    for j in range(5):
        if abs(A[i]-A[j])>k:
            count+=1
if count==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]

max = max(l)
min = min(l)

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

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

t = max(a, b, c, d, e) - min(a, b, c, d, e)

if k < t:
    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('Yay!')
elif b-a > k or c-b > k or d-c > k or e-d > k:
  print(':(')
elif c-a > k or d-b > k or e-c > k:
  print(':(')
elif d-a > k or e-b > k:
  print(':(')
elif e-a > k:
  print(':(')

Solution (Python):



import itertools
box = []
for i in range(0,5):
    box.append(int(input()))
k = int(input())
c = 0
for two in list(itertools.combinations(box,2)):
    if (two[1]- two[0] > k):
        c +=1
    else:
        pass
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())

p1=abs(a-b)
p2=abs(a-c)
p3=abs(a-d)
p4=abs(a-e)
p5=abs(b-c)
p6=abs(b-d)
p7=abs(b-e) 
p8=abs(c-d)
p9=abs(c-e)
p10=abs(d-e)

if((p1>k) or (p2>k) or (p3>k) or (p4>k) or (p5>k) or (p6>k) or (p7>k) or (p8>k) or (p9>k) or (p10>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(':(')
else:
    print('Yay!')

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

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

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

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

Solution (Python):
import sys
A=[]
key=0
for i in sys.stdin.readlines():
    A.append(int(i.rstrip()))
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())
f=int(input())

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

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

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

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

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

Solution (Python):


import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def check(nn, k):
    nnl = len(nn)
    for i in range(nnl):
        for j in range(i+1, nnl):
            d = abs(nn[i] - nn[j])
            if d > k:
                return False
    return True

def main():
    abcde = ii2nn(5)
    k = i2n()
    if check(abcde, k):
        print('Yay!')
    else:
        print(':(')

main()

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

for i in range(5):
    for j in range(1+i, 5):
        
        if (a[j]-a[i]) > a[5]:
            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):
from itertools import combinations

anntena = []
for _ in range(5):
    anntena.append(int(input()))

k = int(input())
frag = True

for combi in combinations(anntena, 2):
    if abs(combi[0] - combi[1]) > k:
        frag = False    
        break
    
if(frag):
    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 = input()
b = input()
c = input()
d = input()
e = input()
k = input()

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

Solution (Python):
list = []
for i in range(5):
  list.append(int(input()))
k = int(input())
 
r = "Yay!"
for a in list:
  for b in list:
    if abs(a-b) > k:
      r = ":("
      break
 
print(r)

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

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,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())

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

ind = 0
for i in A:
    for j in A:
        if(abs(i - j) >k):
            ind = 1

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

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

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

r = "Yay!"
for a in list:
  for b in list:
    if abs(a-b) > k:
      r = ":("
      break

print(r)

Solution (Python):
list1 = [input() for i in range(5)]
num = int(input())
list1 = list(map(int,list1))
list2 = []

for i in range(5):
    for k in range(i+1,5):
        list2.append(list1[k]-list1[i])

if max(list2) <= num:
    print ("Yay!")
else:
    print(":(")

Solution (Python):
A=[]
for i in range(0,6):
  A.append(int(input()))
end=1
for i in range(0,5):
  for j in range(i,5):
    if A[j]-A[i]>A[5]:
      end=0
      break
if end==0:
    print(":(")
else:
	print("Yay!")

Solution (Python):
lis = []

for i in range(5):
    lis.append(int(input()))

NUM = int(input())

count = 0
correct = 0
for i in range(5):
    for k in range(i + 1, 5):
        if lis[k] - lis[i] <= NUM and lis[i] - lis[k] <= NUM:
            correct += 1
        count += 1

if count == correct:
    print('Yay!')
else:
    print(':(')

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


for x in range(len(crd)):
    for y in range(x+1, len(crd)-x):
        
        
        z = k - (crd[y] - crd[x])
        
        if z < 0:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")

Solution (Python):
a,b,c,d,e,k=map(int,open(0).read().split())
print('Yay!' if max(a,b,c,d,e)-min(a,b,c,d,e)<=k else ':(')

Solution (Python):
l = [int(input()) for i in range(5)]
k = int(input())
if max(l)-min(l) > 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())

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

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

Solution (Python):
a=[]
for _ in range (6):
	a.append(int(input()))
k=a[5]
del a[5]
if max(a)-min(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):
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):
in_num = []
conn_frg = 0
for i in range(5):
    in_num.append(int(input()))
line_num = int(input())

for j in range(4):
    k = j+1
    while k < 5:
        if abs(in_num[j] - in_num[k]) > line_num:
            conn_frg = 1
        k += 1

if conn_frg == 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('Yay!')
else:
  print(':(')

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


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

if l[4]-l[0] > k:
    print(':(')
else:
    print('Yay!')

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

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

Solution (Python):
coordinate=[]
for i in range(5):
  coordinate.append(int(input()))
k=int(input())
status=True
for i in range(5):
  for j in range(i):
    if (coordinate[i]-coordinate[j])>k:
      status=False
      
if status:
  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())

r = e - a

if r <= k:
    print("Yay!")
else:
    print(":(")

Solution (Python):


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

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

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

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

Solution (Python):
import itertools
l = []
for _ in range(5):
    l.append(int(input()))
k = int(input())
flag = 0
for ele in itertools.combinations(l, 2):
    if ele[1] - ele[0] > k:
        flag = 1
if flag == 0:
    print('Yay!')
else:
    print(':(')

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

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

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

flag = False
K = int(input())

for j in range(5):
  for kk in range(5):
    if abs(an[j] - an[kk]) > K:
      flag = True
      
print(['Yay!', ':('][flag])

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

Solution (Python):
inpl = []
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
inpl.append(int(input()))
d = int(input())
print(':(' if d < (max(inpl) - min(inpl)) else 'Yay!')

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

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

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

print(":(") if max(S)-min(S)>K else print("Yay!")

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

list_a = [a, b, c, d, e]
list_b = [a, b, c, d, e]
exist = False
for i in list_a:
    for j in list_b:
        if abs(i - j) > k:
            exist = True
if exist:
    print(":(")
else:
    print("Yay!")

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

Solution (Python):
A=list(int(input())for i in range(5))
k=int(input())
dis=max(A)-min(A)
print("Yay!") if dis<=k 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):
antenna = [int(input()) for i in range(5)]
k = int(input())

for i in range (5):
    for j in range (5):
        if i == j:
            pass
        else:
            if abs(antenna[i] - antenna[j]) > k:
                print (":(")
                exit()
            else:
                pass

print ("Yay!")

Solution (Python):
import sys
lists = [int(input()) for i in range(6)]

for i in range(0,5):
    for j in range(i+1,5):
        if(lists[j] - lists[i] > lists[-1]):
            print(":(")
            sys.exit()
print("Yay!")

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

Solution (Python):


import itertools

antennas = []
for _ in range(5):
    antennas.append(int(input()))

combiAntennas = list(itertools.combinations(antennas, 2))

k = int(input())

cnt = 0
for i in combiAntennas:
    if max(i) - min(i) > k:
        cnt += 1
        
if cnt:
    print(':(')
else:
    print('Yay!')

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

k = int(input())

diff = 0

ant_list = []

ant_list.append(a)
ant_list.append(b)
ant_list.append(c)
ant_list.append(d)
ant_list.append(e)

judge = True

for i in range(len(ant_list) - 1):

    for j in range(5-i):
        diff  = ant_list[4-j] - ant_list[i]

        if diff > k:
            judge = False
            break
    else:
        continue

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

Solution (Python):
from sys import stdin

i = [int(x) for x in stdin.readlines()]
j = i[-1]
i.pop()

if max(i)-min(i) > j:
  print(':(')
else:
  print('Yay!')

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

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

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

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

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    
    l = [int(input()) for i in range(6)]
    
    if l[4] - l[0] > l[5]:
        print(':(')
    else:
        print('Yay!')
    
if __name__ == '__main__':
    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("Yay!")
else:
    print(":(")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=min(a,b,c,d,e)
g=max(a,b,c,d,e)
h=g-f
if h <= 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 = 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):
antenna = [0]*5
for i in range(5):
    antenna[i] = int(input())

k = int(input())
ans = "Yay!"

for i in range(5):
    if antenna[0] + k < antenna[i]:
        ans = ":("
        break

print(ans)

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

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

flag = 0
for i in range(5):
  if flag == 1:
    break
    
  for j in range(5):
    if i == j or i > j:
      continue
    if antennas[j] - antennas[i] > k:
      print(':(')
      flag = 1
      break
 
if flag == 0:
  print('Yay!')

Solution (Python):
from itertools import combinations

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

com = [True if antennae[j] - antennae[i] <= k else False for i, j in combinations(range(5), 2)]
if sum(com) == len(list(combinations(range(5), 2))):
    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):
lst=[int(input()) for _ in range(5)]
k=int(input())
if max(lst)-min(lst)<=k:
    print("Yay!")
else:
    print(":(")

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

Solution (Python):
i1 = []
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i2 =(int(input()))

 
for i in i1:
  for n in i1:
    if abs(i - n) > i2:
      ans = ':('
      break
    else:
      ans = 'Yay!'
      
print(ans)

Solution (Python):



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

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

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

o=int()

if (b-a >k):
  o = 1
elif (c-a >k):
  o = 1
elif (d-a >k):
  o = 1
elif (e-a >k):
  o = 1
  
elif (c-b >k):
  o = 1
elif (d-b >k):
  o = 1
elif (e-b >k):
  o = 1
elif (d-c >k):
  o = 1
elif (e-c >k):
  o = 1
elif (e-d >k):
  o = 1
else:
  o = 0

if( o == 1 ):
  print (':(')
else:
  print ('Yay!')

Solution (Python):
import sys
 
antennas = [int(input()) for _ in range(5)]
k = int(input())
 
for p in range(5):
  for q in range(p+1,5):
    if antennas[q] - antennas[p] > 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):
l=[int(input()) for _ in range(6)]
print(':(' if l[4]-l[0]>l[5] else 'Yay!')

Solution (Python):
abcde = []
for i in range(5):
    abcde.append(int(input()))
k = int(input())
for i in range(5):
    for j in range(5):
        if abcde[i]-abcde[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())

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

Solution (Python):
if __name__ == '__main__':
	a = [int(input()) for _ in range(5)]
	k = int(input())
	a.sort(reverse=True)
	for i in range(4):
		j = i+1
		for j in range(5):
			if(a[i]-a[j]>k):
				print(":(")
				exit()
	print("Yay!")

Solution (Python):
import sys

ak = list()
for i in range(0,5):
    ak.append(int(input()))
ranger = int(input())

for i in ak:
    for k in ak:
        if (i - k) > ranger:
            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(":(")

elif d-a>k:
    print(":(")

elif e-a>k:
    print(":(")

elif c-a>k:
    print(":(")

elif b-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())

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
    print('Yay!')
else:
    print(':(')

Solution (Python):
src = [int(input()) for i in range(6)]
judge = [':(','Yay!']
ok = True
for i in range(5):
    for j in range(i,5):
        if abs(src[i]-src[j]) > src[5]:
            ok = False
print(judge[1] if ok else judge[0])

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

k = int(input())
if a[-1] - a[0] <= k:
    print('Yay!')
else:
    print(':(')

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

Solution (Python):


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

Solution (Python):
from itertools import permutations

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

ans = True
for p, q in permutations(a, 2):
    if q - p > k:
        ans = False
        break

if ans:
    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 max(a,b,c,d,e) - min(a,b,c,d,e) > k:
    print(':(')
else:
    print("Yay!")

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

if (A[-1]-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(':(')
else:
  print('Yay!')

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(':(')
else:
    print('Yay!')

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

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

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

for i1 in reversed(range(5)):
    for i2 in reversed(range(i1-1)):
        ans = int(list_1[i1]) - int(list_1[i2])
        if ans > int(list_1[5]):
            print(":(")
            sys.exit()
        else:
            continue

print("Yay!")

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

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

for i1 in reversed(range(5)):
    for i2 in reversed(range(i1-1)):
        ans = int(list_1[i1]) - int(list_1[i2])
        if ans > int(list_1[5]):
            print(":(")
            sys.exit()
        else:
            continue

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

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

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

Solution (Python):
L = []
for i in range(6):
    n = int(input())
    L.append(n)
    
k = L.pop()

cnt = 1
ans = "Yay!"
for i in range(len(L) - 1):
    for j in range(1, 5 - cnt + 1): 
        if abs(L[i] - L[j]) > k:
            ans = ":("
            break
    cnt += 1
print(ans)

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(':(')
else:
    print('Yay!')

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

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

Solution (Python):
inpt=[input() for i in range(6)]
a=int(inpt[0])
e=int(inpt[4])
k=int(inpt[5])
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(":(")
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("Yay!")
else:
    print(":(")

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

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

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

Solution (Python):
P = [int(input()) for _ in range(5)]
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())

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

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

Solution (Python):
lst = []

for i in range(5):
    num = int(input())
    lst.append(num)

k = int(input())

b = 1
for a in lst:
    if k < a-lst[0]:
        print(":(")
        break
    b += 1

if b == 6:
    print("Yay!")

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

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

if (max(num) - min(num)) > 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 = (e - a) > k

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

Solution (Python):
import sys

nums = []

for i in range(5):
  nums.append(int(input()))

k = int(input())

for i in range(5):
  for j in range(5-i)[1:]:
    if nums[j] - nums[i] > k:
      print(":(")
      sys.exit()

print("Yay!")

Solution (Python):
if __name__ =="__main__":
    kyori = []
    for x in range(5):
        kyori.append(input())
    
    k = input()

    max_length=int(kyori[4])-int(kyori[0])

    if max_length <= int(k):
        print("Yay!")
    else:
        print(":(")

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

ren = max(an)-min(an)

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

Solution (Python):

lst = list(map(int, [input() for _ in range(5)]))
k = int(input())

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

Solution (Python):

lst = list(map(int, [input() for _ in range(5)]))
k = int(input())
answer = "Yay!"
count = 0

for i in range(4, 0, -1):
    count += 1
    for j in range(4 - count):
        if lst[i] - lst[j] > k:
            answer = ":("
            break
    break

print(answer)

Solution (Python):

lst = list(map(int, [input() for _ in range(5)]))
k = int(input())
answer = "Yay!"
count = 0

for i in range(4, 0, -1):
    count += 1
    for j in range(4 - count):
        if lst[i] - lst[j] > k:
            answer = ":("

print(answer)

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

Solution (Python):


a=[int(input()) for i in range(5)]
k=int(input())
ans=True
for i in range(5):
    for j in range(5):
        if abs(a[i]-a[j]) > k:
            ans=False
if ans:
    print("Yay!")
else:
    print(":(")