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 numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if k>=b-a and k>=c-a and k>=d-a and k>=e-a and k>=c-b and k>=d-b and k>=e-b and k>=d-c and k>=e-c and k>=e-d:
  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):
def solve(string):
    a, *_, e, k = map(int, string.split())
    return "Yay!" if e - a <= k else ":("


if __name__ == '__main__':
    print(solve('\n'.join([input() for _ in range(6)])))

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

if (e-a)>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 = [a,b,c,d,e]
flag = True
for i in range(5):
	for j in range(5):
		
		if i == j:
			continue
		else:
			if abs(l[i]-l[j]) > k:
				flag = False
				break

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

Solution (Python):
lists = [0,0,0,0,0,0]
for i in range(len(lists)):
        lists[i] = int(input())

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

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

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

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

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

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

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

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

for i in range(4):
    for j in range(i+1,5-i):
        if (l[j] - l[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 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())

ss=max(a,b,c,d,e)-min(a,b,c,d,e)
if ss>k:
  print(":(")
else:
  print("Yay!")

Solution (Python):
a = int(input())
for i in range(4):
    e = int(input())
if e-a <= int(input()):
    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 = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

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

else:
    print(":(")

Solution (Python):
import sys

input = sys.stdin.readline

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

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())
count = 0

if B - A > K:
    count += 1
elif C - A > K:
    count += 1
elif D - A > K:
    count += 1
elif E - A > K:
    count += 1
elif C - B > K:
    count += 1
elif D - B > K:
    count += 1
elif E - B > K:
    count += 1
elif D - C > K:
    count += 1
elif E - C > K:
    count += 1
elif E - D > K:
    count += 1

if count >= 1:
    print(':(')
else:
    print('Yay!')

Solution (Python):


List = list(int(input()) for i in range(5))
K = int(input())

times = int(0)

for j in range(len(List) - 1):
    for k in range(len(List) - 1):
        if(List[-j] - List[k] > K):
            
            times += 1
            
if(times == 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):
import sys

na1 = []

for i1 in range(5):
    na1.append(int(input()))

n1 = int(input())

for i2 in range(5):
    for i3 in range(5):
        if i3 <= i2:
            continue
        elif (na1[i3] - na1[i2]) > n1  :
            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 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!")

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

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

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

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

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

Solution (Python):


if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    ant = [a, b, c, d]
    f = False
    for i in ant:
        if e - i > k:
            f = True
            break
    if f:
        print(':(')
    else:
        print('Yay!')

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

    for i in reversed(range(5)):
        for j in reversed(range(i)):
            if antennas[i] - antennas[j] > k:
                print(':(')
                return

    print('Yay!')


abc()

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

k = int(input())

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

for j in range(4):
    for i in range(j, 4):
        dist = homes[i + 1] - homes[j]
        if k < dist:
            print(':(')
            exit()
print('Yay!')

Solution (Python):
a, *_, e, k = [int(input()) for x in ' '*6]
print([':(', 'Yay!'][e-a<=k])

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

k = int(input())

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

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

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

if check <= 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(5):
        if abs(A[i] - A[j]) > k:
            print(':(')
            exit()
print('Yay!')

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

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

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

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

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

Solution (Python):






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





max_d = coord[-1]-coord[0]





if max_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("Yay!")
else:
    print(":(")

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

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

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

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

print("Yay!")

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

flag = 0
for i in a:
    for j in a:
        if abs(i-j) > k:
            flag = 1
            break            
    else:
        continue
    break

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

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

Solution (Python):
from itertools import combinations

A = [int(input()) for _ in range(5)]
K = int(input())
for x, y in combinations(A, 2):
    if abs(x - y) > K:
        print(':(')
        exit()
print('Yay!')

Solution (Python):


import sys

L = list(int(input()) for i in range(6))

for i in range(5):
        for j in range(5):
            if abs(L[i]-L[j]) > L[5]:
                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())

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

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

print("Yay!")

Solution (Python):



import sys

input = sys.stdin.readline

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

    for i in range(5):
        for j in range(i+1, 5):
            if A[j] - A[i] > k:
                print(":(")
                return

    print("Yay!")

main()

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

Solution (Python):
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)

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

k = int(input())
def kyori(p,q):
    if p-q > 0:
        return p-q
    else:
        return q-p

sub = []
for i in range(len(inp)):
  for j in range(len(inp)):
      if i < j:
          sub.append(kyori(inp[i],inp[j]))
      else:
          pass

if max(sub) > 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())
f = True
l = [a, b, c, d, e]
for m in range (0, 5):
    for n in range(m, 5):
        if l[n] - l[m] > k:
            f = False

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

Solution (Python):
point = []

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

k = int(input())

for i in range(5) :
    for j in range(5) :
        if abs(point[i] - point[j]) > k :
            print(':(')
            break
    else :
        continue
    break
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):

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

k = int(input())

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

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

ans = 'Yay!'
for l in ls:
    for n in ls:
        if l - n > k:
            ans = ':('

print(ans)

Solution (Python):

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

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

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

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

Solution (Python):
import sys

list=[]
num=6

for i in range(num):
    list.append(int(input()))
    if list[i]<0 or list[i]>123:
        print("Unexpected this input.")
        sys.exit()

for i in range(num-1):
    for j in range(num-1):
        if list[i]-list[j-1]>list[5]:
            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):
nums=[]

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

k=int(input())

for i in range(len(nums)):
    for j in range(i+1,len(nums)):
        if abs(nums[i]-nums[j])>k:
            print(":(")
            exit()

print("Yay!")

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

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

l_max = max(a,b,c,d,e)
l_min = min(a,b,c,d,e)

if((l_max-l_min) > k):
    print(':(')
else:
    print('Yay!')

Solution (Python):
a,b,c,d,e,k=[int(input()) for i 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())

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

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

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

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

k = int(input())

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

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

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

Solution (Python):
a = [0 for _ in range(5)]

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

dist = a[4]-a[0]

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

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

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

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

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

Solution (Python):
import sys
import os


dis=0
qmin=123
qmax=0
for i in range(5):
    a=int(input())
    qmin=min(qmin,a)
    qmax=max(qmax,a)

if qmax - qmin<=int(input()):
    print("Yay!")
else:
    print(":(")

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


if L[4]-L[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(':(')
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())
b=int(input())
b=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):
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):
a = []
for i in range(6):
    a.append(int(input()))

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    v = []
    for _ in range(5):
        v.append(int(input()))
    k = int(input())
    v.sort()

    if abs(v[0] - v[-1]) > k:
        print(":(")
    else:
        print("Yay!")




if __name__ == '__main__':
    main()

Solution (Python):
def main():
    a = [int(input()) for i in range(5)]
    k = int(input())
    ans = False
    for aa in a:
        for b in a:
            if abs(aa-b) > k:
                ans = True
                break
        if ans:
            break
    print(':(' if ans else 'Yay!')

if __name__ == '__main__':
    main()

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

Solution (Python):
A = [int(input()) for i in range(6)]
ans = 0
for i in A:
    ans += len(list(filter(lambda x: (i - x) > A[-1], A)))
print('Yay!' if ans == 0 else ':(')

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

for i in antenna:
    antenna_out = list(filter(lambda j: (i - j) > k, antenna))
    if len(antenna_out) != 0:
        print(":(")
        break
else:
    print("Yay!")

Solution (Python):
antena = [0, 0, 0, 0, 0, 0]
ng_count = 0

for i in range(0, 6):
    antena[i] = int(input()) 

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

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

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

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

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

dai = max([a,b,c,d,e])
shou = min([a,b,c,d,e])

if (dai - shou) <= k:
    print("Yay!")
else:
    print(":(")

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

a = int(inputstr1[0])
b = int(inputstr1[1])
c = int(inputstr1[2])
d = int(inputstr1[3])
e = int(inputstr1[4])
k = int(inputstr1[5])

inputmax = max(a, b, c, d, e)
inputmin = min(a, b, c, d, e)


if inputmax - inputmin <= 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):
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):
s = int(input())
for _ in range(3):
    input()
g = int(input())
k = int(input())

if k < g - s:
    print(":(")
else:
    print("Yay!")

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=max([a,b,c,d,e])
g=min([a,b,c,d,e])
z= f-g
if (z>k):
    print(':(')
else :
    print('Yay!')

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
max=a
min=a
if (max<b):
    max=b
if (max<c):
    max=c
if (max<d):
    max=d
if (max<e):
    max=e
if (min>b):
    min=b
if (min>c):
    min=c
if (min>d):
    min=d
if (min>e):
    min=e
z= max-min
if (z>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())

ant = [a,b,c,d,e]
for i in range(1,5):
    for j in range(0,i):
        if ant[i] - ant[j] > k:
            print(':(')
            exit()
print('Yay!')

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

a = int(a)
e = int(e)
k = int(k)

ans = "Yay!"
if e - a > k:
    ans = ":("

print(ans)

Solution (Python):
def main():
    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(":(")


if __name__ == "__main__":
    main()

Solution (Python):
if __name__ == "__main__":
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

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

Solution (Python):
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def II(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def SI(): return input()
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')

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

if li[-1] - li[0] > k:
    print(':(')
    sys.exit()

print('Yay!')

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

direct = True
for i in range(5):
    for j in range(5):
        if abs(list[i]-list[j]) > k:
            direct = False
if direct:
    print('Yay!')
else:
    print(':(')

Solution (Python):
import sys
a, b, c, d, e, k = map(int,sys.stdin.readlines())
if e - a > k:
  print(":(")
else:
  print("Yay!")

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

bad_flag = False
for i,ant in enumerate(antena):
	for bnt in antena[i:] :
		if abs(ant - bnt) > k :
			bad_flag = True 
	if bad_flag :
		break

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

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


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

if __name__ == "__main__":
    main()

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

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

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

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


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

Solution (Python):
A = []
for i in range(5):
  str = input()
  A.append(int(str))
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=list(map(int, [input() for i in range(6)]))
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(":(")
else:
    print("Yay!")

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

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

Solution (Python):
L = []

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

if L[-1] - L[0] > k:
  print(":(")

else:
  print("Yay!")

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

k=int(input())

for i in range(len(x) - 1):
    for j in range(i + 1, len(x)):
        if x[j] - x[i] > k:
            print(':(')
            quit()
    
print('Yay!')

Solution (Python):
def sub():
    items = [int(input()) for _ in range(6)]
    aa = items[:5]
    k = items[5]
    d = aa[-1] - aa[0]
    if d > k:
        print(":(")
    else:
        print("Yay!")

sub()

Solution (Python):
antenas = [int(input()),int(input()),int(input()),int(input()),int(input())]
k = int(input())
flg = False

for i in antenas:
    for j in antenas:
        flg = abs(j - i) > k
        if flg:
            break

if flg:
    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,*_,e,k=[int(input())for x in' '*6];print(['Yay!',':('][e-a>k])

Solution (Python):
a,*_,e,k=[int(input())for x in' '*6];print([':(','Yay!'][e-a<=k])

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

cnt = 0
for i in range(5):
    for j in range(5):
        diff = abs(l[i] - l[j])
        if diff > k:
            cnt += 1

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

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

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