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

"""
Created on Mon Apr  8 14:51:17 2019

@author: adachi-lab
"""

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

for q in range(4):
    y.append(input_code[-1]-input_code[q])
    
for w in range(3):
    y.append(input_code[-2]-input_code[w])
    
for j in range(2):
    y.append(input_code[-3]-input_code[j])
    
y.append(input_code[1]-input_code[0])


if max(y) > k:
    print(':(')
    
else:
    print('Yay!')

Solution (Python):
from sys import exit


a = [int(input()) for _ in range(5)]
k = int(input())
for e0 in a:
    for e1 in a:
        if abs(e0 - e1) > k:
            print(":(")
            exit()
print("Yay!")

Solution (Python):


antenna = []

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

k = int(input())

ans = 'Yay!'

for j in range(4):
    for l in range(j+1, 5):
        if abs(antenna[j] - antenna[l]) > k:
            ans = ':('

print(ans)

Solution (Python):
import itertools as itr

antenna = []

s = 0

for _ in range(5) : 
    antenna.append(int(input()))
    
k = int(input())

l = list(itr.combinations(antenna, 2))

for i in l : 
    if (abs(i[0] -i[1])) > k :
        s = 1

if (s == 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())
list = [a,b,c,d,e]
for i in range(4):
    for j in range(4-i):
        if list[j+1]-list[i] <k+1:
            continue
        else:
            print(":(")
            exit()
print("Yay!")

Solution (Python):
A = [input() for _ in range(5)]
K = int(input())
if int(A[-1])-int(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())
face='Yay!'
dlist=[e-d,e-c,e-b,e-a,d-c,d-b,d-a,c-b,c-a,b-a]
for i in range(0,10):
  if dlist[i]>k:
    face=':('
    break
  else:
    pass
print(face)

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

Solution (Python):
Antennas=list()

for i in range(5):
    Antennas.append(input())

k = int(input())


result = int(Antennas[4]) - int(Antennas[0])

if result > 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())

maxDist = e-a 

if (maxDist<=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):
antennas = []
for _ in range(5):
  a = int(input())
  antennas.append(a)
k = int(input())
cannot_communicate_pair_exists = False
for i in range(len(antennas)):
  for q in range(len(antennas)):
    if i == q:
      continue
    if abs(antennas[i]-antennas[q]) > k:
      cannot_communicate_pair_exists = True
      break
  if cannot_communicate_pair_exists:
    break
if cannot_communicate_pair_exists:
  print(":(")
else:
  print("Yay!")

Solution (Python):


l=[]
for i in xrange(6):
 l.append(int(raw_input()))
k=l[-1]
if l[4]-l[0]>k:
 print ':('
else:
 print 'Yay!'

Solution (Python):


l=[]
for i in xrange(6):
 l.append(int(raw_input()))
k=l[-1]
if l[4]-l[0]>k:
 print ':('
else:
 print 'Yay!'

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

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

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

Solution (Python):
beacon=[0]*5
for i in range(5):
    beacon[i]=int(input())
if beacon[4]-beacon[0] > int(input()):
    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-d<=k and e-c<=k and e-b<=k and e-a<=k and d-c<=k and d-b<=k and d-a<=k and c-b<=k and c-a<=k and b-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()) for _ in range(5)]
k=int(input())

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

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

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

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
fl = True
s = [a,b,c,d,e]
for i in range(len(s)):
    for j in range(len(s)):
        if j <= i:
            continue
        if s[j]-s[i] > k:
            fl = False
if fl:
    print("Yay!")
else :
    print(":(")

Solution (Python):
a = int(input())
d = int(input())
f = int(input())
h = int(input())
e = int(input())
k = int(input())

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

Solution (Python):
from sys import exit

distance = [int(input()), int(input()), int(input()), int(input()), int(input())]

k = int(input())

for i in range(5):
    for j in range(i + 1, 5):
        if distance[j] - distance[i] > k:
            print(':(')
            exit()
print('Yay!')

Solution (Python):
a = int(input())
_ = int(input())
_ = int(input())
_ = int(input())
e = int(input())
k = int(input())

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

Solution (Python):
a = int(input())
_ = int(input())
_ = int(input())
_ = int(input())
e = int(input())
k = int(input())

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

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


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


flag = True

for i in range(5):
    y = list[0]
    list.pop(0)
    
    alist = map(lambda x: x - y, list)
    
    if (all([z <= k for z in alist])) == False:
        flag = False
        break
    else:
        continue
        break

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

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

max_a = max(a)
min_a = min(a)
if(abs(max_a - min_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()) for i in range(6)]
print("Yay!" if a[4]-a[0]<=a[5] else ":(")

Solution (Python):
x = [int(input()) for i in range(6)]
i = 0
j = 0
flag = 0
while i <= 5 and flag == 0:
    while j <= 5:
        if x[i]-x[j] > x[5]:
            print(":(")
            flag = 1
            break
        j += 1
    i += 1
    j = 0

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

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

Solution (Python):



import sys


def solve(l,k):
  for i in range(5):
    for j in range(5):
      if abs(l[i]-l[j] > k):
        return False
  return True


l = []
for _ in range(5):
  l.append(int(input()))
k = int(input())
if solve(l,k):
  print("Yay!")
else:
  print(":(")

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

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

if k >= (max(li)-min(li)):
    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):
list = []
for i in range(5):
	list.append(int(input()))
k = int(input())

for i in range(5):
  for j in range(4-i):
    if list[i+1+j] - list[i] > k:
      print(":(")
      break
  else:
    print("Yay!")
  break

Solution (Python):
a = [int(input()) for _ in range(5)]
k = int(input())
res = False
for i in range(len(a)):
  for j in range(i + 1, len(a)):
    if a[j] - a[i] > k:
      res = True
      break
  else:
    continue
if res:
  print(':(')
else:
  print('Yay!')

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

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

Solution (Python):
def main():
    X = [int(input()) for _ in range(5)]
    k = int(input())
    for i in range(5):
        for j in range(i+1, 5):
            if X[j] - X[i] > k:
                print(":(")
                return
    print("Yay!")


if __name__ == "__main__":
    main()

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

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

from itertools import combinations

for a1, a2 in combinations(antennas, 2):
    if abs(a1 - a2) > k:
        print(':(')
        break
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(":(")
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()) for i in range(5)]
m=int(input())
s=0
for i in range(5):
    for k in range(5):
        n=a[k]-a[i]
        if n>m:
            s+=1
if s!=0:
    print(":(")
else:
    print("Yay!")

Solution (Python):



def main():
    abcde = [int(input()) for _ in range(5)]
    k= int(input())

    for i in range(4):
        for j in range(i+1, 5):
            if abcde[j] - abcde[i] > k:
                print(":(")
                exit()
    print("Yay!")

if __name__ == "__main__":
    main()

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

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

Solution (Python):
output = 'Yay!'
antennas = []
for i in range(5):
    antennas.append(int(input()))
area = int(input())

for i in range(5):
    for j in range(i+1,5):
        if max(antennas[i],antennas[j])-min(antennas[i],antennas[j]) > area:
            output = ':('
            break
    else:
        continue
    break

print(output)

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

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

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

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

k = int(input())

amax = max(a)
amin = min(a)
if (amax - amin) <= k :
    print("Yay!")
else:
    print(":(")

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

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()) for i in range(6)]
def Five(A):
    if A[-2]-A[0] > A[-1]:
        return print(":(")
    return print("Yay!")
Five(A)

Solution (Python):
antena = [int(input()) for x in range(5)]
lim = int(input())
boo = True
for i in range(1, 5):
  for j in range(i):
    k = antena[i] - antena[j]
    if k > lim:
      boo = False
if boo:
  print("Yay!")
else:
  print(":(")

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

Solution (Python):
A = []

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

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

for i in range(5):
    b = int(input())
    a.append(b)
    
import itertools

c =itertools.combinations(a,2)

for v in c:
    d = list(v)
    x = abs(d[0]-d[1])
    y.append(x)
    
n = int(input())

m = 0

for l in range(len(y)):
    if y[l] > n:
        print(":(")
        break
    else:
        m += 1
        if m == (len(y)):
            print('Yay!')

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


print(ans)

Solution (Python):
import itertools

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

k = int(input())

d2 = [abs(i[0] - i[1]) for i in list(itertools.combinations(d, 2))]

over = [i for i in d2 if i > k]
if len(over) == 0 :
  print("Yay!")
else:
  print(":(")

Solution (Python):






args = []
for _ in range(5):
    tmp = int(input())
    args.append(tmp)
k = int(input())
for i in range(5):
    for j in range(i+1, 5):
        if i == j:
            continue
        dis = args[j] - args[i]
        if dis > k:
            print(':(')
            exit()
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):
a=[int(input()) for i in range(6)]
b=a[4]-a[0]
if a[5]>=b:
    print('Yay!')
else:
    print(':(')

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]


for x in antennas:
    for y in antennas:
        if y-x > k:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")

Solution (Python):
import sys, os

if __name__=='__main__':
    if 'local' in os.environ :
        sys.stdin = open("./input.txt", "r")

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

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

Solution (Python):
def main ():
    antennas= [int(input()) for _ in range(5)]
    max_len     = int(input())
    print (distance_comparison(max_len,antennas))

def distance_comparison(max_len,antennas):
    if max(antennas) - min(antennas) <= max_len:
        return "Yay!"
    return ":("

main()

Solution (Python):
a, b, c, d, e = int(input()),int(input()),int(input()),int(input()),int(input())
k = int(input())
print("Yay!"if e-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:
  print(':(')
else:
  print('Yay!')

Solution (Python):
a = [int(input()) for _ in range(5)]
K = int(input())
print("Yay!" if a[-1]-a[0]<=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:
    print(":(")
else:
    print('Yay!')

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

difmax = e - a
if difmax > 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):
p={}
for i in range(5):
    p[i] = int(input())
k = int(input())

flag = bool(False)
for i in range(1,5):
    for j in range(0,i-1):
        if k < p[i]-p[j] :
            flag = True

if flag == False:
    print("Yay!")
if flag == True:
    print(":(")

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

ng = ":("
ok = "Yay!"
if A[4] - A[0] <= K:
    print(ok)
else:
    print(ng)

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

Solution (Python):
import numpy as np
import sys

a = []
for i in range(5):
	a.append(int(raw_input()))
k = int(raw_input())
b = np.array(a)

for i in range(5):
	for j in range(5-i):
		if a[i+j] - a[i] > k:
			print ':('
			sys.exit()

print 'Yay!'

Solution (Python):
import itertools

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

v = (a, b, c, d, e)
if all(abs(v1 - v2) <= k for v1, v2 in itertools.product(v, repeat=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())

ABCDE = [a, b, c, d, e]
distance = max(ABCDE) - min(ABCDE)

if distance > k:
    ans = ':('
else:
    ans = 'Yay!'
    
print(ans)

Solution (Python):
import sys

def Main():
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())
    
    ans = 'Yay!'
    
    ed = e-d
    ec = e-c
    eb = e-b
    ea = e-a
    dc = d-c
    db = d-b
    da = d-a
    cb = c-b
    ca = c-a
    ba = b-a
    
    if ed > k:
    	ans = ':('
    
    if ec > k:
    	ans = ':('

    if eb > k:
    	ans = ':('
    
    if ea > k:
    	ans = ':('
        
    if dc > k:
    	ans = ':('
        
    if db > k:
    	ans = ':('
    
    if da > k:
    	ans = ':('
    
    if cb > k:	
    	ans = ':('
        
    if ca > k:
    	ans = ':('
        
    if ba > k:
    	ans = ':('
       
    
    print(ans)

Main()

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

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):
n=[0]*5
for i in range(5):
  n[i]=int(input())
k=int(input())
mi=min(n)
ma=max(n)
if k >=ma-mi:
  print("Yay!")
else:
  print(":(")

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

Solution (Python):
import sys

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





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

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

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

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

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

D = True

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

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

Solution (Python):
import sys
aLen = [int(_) for _ in sys.stdin.readlines()]
K= aLen[5]
for i in range(5):
    for j in range(1,5):
        if K < abs(aLen[i] - aLen[j]) :
            print(":(")
            exit()
print("Yay!")

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

if max(a_list[:5]) - min(a_list[:5]) <= a_list[5]:
    print("Yay!")
else:
    print(":(")

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

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

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

Solution (Python):

def main():
    _min, _max = 123, 0
    for _ in range(5):
        i = int(input())
        if _min > i:
            _min = i
        if i > _max:
            _max = i
    k = int(input())

    print(":(" if _max-_min > k else "Yay!")


main()

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

result = 0
if e - a <= k:
    print('Yay!')
elif e - a > k:
    print(':(')

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

if max(a[:-1]) - min(a[:-1]) > a[-1]:
  print(":(")
else:
  print("Yay!")

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

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

Solution (Python):
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n

def zeros2(n, m): return [zeros(m) for i in range(n)] 

INF = 10**18

class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                w = cmt + ': ' + str(x)
            else:
                w = str(x)
            print(w)
        return x

def prob():  
    d = Debug()
    d.off()
    N = 6
    dist = zeros(N)
    for i in range(6):
        dist[i] = int(input())
    d.dmp((dist),'dist')
    K = dist[5]
    d.dmp((K),'K')
    for i in range(4):
        if dist[i+1]-dist[i] > K:
            return ':('
    if dist[4]-dist[0] > K:
        return ':('
    return 'Yay!'
    

ans = prob()
print(ans)

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

for i in range(N):
    for j in range(N):
        if k < abs(a2e[i] - a2e[j]):
            print(':(')
            exit()

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,*_,e,k=eval('int(input()),'*6);print('Y:a(y !'[e-a>k::2])

Solution (Python):
a,*_,e,k=eval('int(input()),'*6);print('Y:a(y !'[e-a>k::2])

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):
*a,k=[int(input()) for i in range(6)]
for i in a:
    if i-a[0]>k:
        print(":(")
        break
else:
    print("Yay!")

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

k = int(input())

list_mutual_distance = []


for i in list_antennas:
	for j in list_antennas:
		if j <= i:
			continue
		else:
			dist_ij = j - i
			list_mutual_distance.append(dist_ij)

max_distance = max(list_mutual_distance)


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

Solution (Python):
array1 = [int(input()) for i in range(6)]
array2 = array1[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')

Solution (Python):
from sys import stdin

def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri():
    return int(input())

L = [0] * 5
for i in range(5):
    L[i] = ri()
K = ri()

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

Solution (Python):
no = ":("
yes = "Yay!"
a = int(input())
e = int(input())
e = int(input())
e = int(input())
e = int(input())
k = int(input())
if abs(a-e) <= k:
  print(yes)
else:
  print(no)

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

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

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

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

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

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

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

Solution (Python):

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

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

Solution (Python):
ma = -1
mi = 124
for _ in range(5):
    n = int(input())
    ma = max(ma, n)
    mi = min(mi, n)
k = int(input())

if ma-mi <= 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()) for i in range(5)]
k=int(input())
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("Yay!")
else:
    print(":(")

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
 
p_list = [a, b, c, d, e]
neg_pair = False
 
for i in range(5):
  for j in range(5):
    dist = abs(p_list[i] - p_list[j])
    if dist > k:
      neg_pair = True
      break
if neg_pair:
  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("Yay!")
else:
    print(":(")

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

if l[4]-l[0]<=l[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):
inp = [int(input()) for _ in range(5)]
k=int(input())
inp.sort()
sa = abs(inp[0] - inp[-1])
if sa > k:
    print(":(")
else:
    print("Yay!")

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

Solution (Python):
a,*_,e,k=eval('int(input()),'*6);print(':('*(e-a>k)or'Yay!')

Solution (Python):
import sys

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

if (args[4] - args[0]) > args[5]:
    print(":(")
    sys.exit()
print("Yay!")

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

Solution (Python):
a,b,c,d,e,f=map(int,open(0).readlines())
print(":("if e-a>f else"Yay!")

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

Solution (Python):
import sys

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


for arg1 in args[:5]:
    for arg2 in args[1:5]:
        if (arg2 - arg1) > args[5]:
            print(":(")
            sys.exit()
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 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())

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

isConnection = True

for t in antenna:
    for u in antenna:
        if abs(t-u) > k:
            isConnection = False

if isConnection:
    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):
x = [int(input()) for i in range(6)]
if x[4]-x[0]>x[5]: print(":(")
else: print("Yay!")

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

i0 = int(i[0])

i1 = int(i[1])

i2 = int(i[2])

i3 = int(i[3])

i4 = int(i[4])

i5 = int(i[5])



if  i4 - i0 > i5:
    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 and e - b <= 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())

if (max(A)-min(A) <= K):
    print("Yay!")
else:
    print(":(")

Solution (Python):

a = 0
antennas = []
k = 0
flg = True


a = int(input())
for i in range(4):
    antennas.append(int(input()))
k = int(input())


for i in range(4):
    if antennas[i] - a > k:
        flg = False


if flg == True:
    print("Yay!")
else:
    print(":(")

Solution (Python):
import itertools

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

    for i in list(itertools.combinations(a, 2)):
        if abs(i[1]-i[0]) > k:
            print(":(")
            break
    else:
        print("Yay!")

main()

Solution (Python):
inputs=[int(input()) for i in range(6)]
k=inputs[-1]
T=False
for i in range(5):
  for j in range(5-i):
    if abs(inputs[5-j]-inputs[i-1])>k:
      print(":(")
      quit()

print("Yay!")

Solution (Python):
*Pos, K = [int(input()) for _ in range(6)]
print('Yay!' if Pos[4] - Pos[0] <= 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:
  print('Yay!')
else:
  print(':(')

Solution (Python):


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

k = int(input())
cpt = 0
for i in range(5):
    for j in range(i+1,5):
        if arr[j] - arr[i] > k:
            cpt = 1
if cpt:
    print(':(')
else:
    print('Yay!')