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):
s = [int(input()) for i in range(5)]
k = int(input())
c = 0 
for i in range(5):
    for j in range(i+1,5):
        t = s[j] -s[i]
        if t > k:
            c = 1
        else:
            continue

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

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

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

Solution (Python):
a = [int(input()) for _ in range(5)]
k = int(input())
flg = True
for i in range(5):
    for j in range(5):
        if a[i] - a[j] > k:
            flg = False
if flg:
    print('Yay!')
else:
    print(':(')

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

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

ans = 'Yay!'
if (ant[-1] - ant[0] > k):
    ans = ':('

print(ans)

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

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

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

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

ok = True
for s,t in itertools.combinations(l,2):
	if abs(s-t) > k:
		ok = False

if ok:
	print('Yay!')
else:
	print(":(")

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

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

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

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

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

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

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

for i in range(4):
    for j in range(i+1, 5):
        if A[j] - A[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(':(')
else:
    print('Yay!')

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

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

Solution (Python):
ant_list = [int(input()) for _ in range(5)]
k = int(input())
flg = True
for t in ant_list:
    for j in ant_list:
        if abs(t-j)>k:
            flg = False

if flg:
    print("Yay!")

else:
    print(":(")

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

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

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

stdout = sys.stdout
rr = lambda: input().strip()
rri = lambda: int(rr())
rrm = lambda: list(map(int, rr().split()))

a = rri()
b = rri()
c = rri()
d = rri()
e = rri()
k = rri()

lst = [a,b,c,d,e]
while True:
    for i, ant in enumerate(lst[:4]):
        for j, ant2 in enumerate(lst[i:]):
            if ant2 - ant > k:
                print(':(')
                quit()

    print('Yay!')
    quit()

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

dfs = int(input())

if polls[4] - polls[0] <= dfs:
    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):
li = [int(input()) for _ in range(5)]
k = int(input())

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

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

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

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

flag=1
for i in range(5):
    for j in range(5):
        if abs(distance[i]-distance[j])>k:
            flag=0
if flag:
    print("Yay!")
else:
    print(":(")

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

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

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

Solution (Python):
antena = [int(input()) for i in range(5)]
k = int(input())
ans = 1
for i in antena:
    for j in antena:
        if i != j and abs(i - j) > k:
            ans = -1
            break
    if ans == -1:
        break

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

Solution (Python):
def five_antennas(a: int, b: int, c: int, d: int, e: int, k: int)->bool:
    antennas = [a, b, c, d, e]
    for i in range(5):
        for j in range(i+1, 5):
            if k < antennas[j] - antennas[i]:
                return False
    return True


if __name__ == "__main__":
    inputs = [int(input()) for _ in range(6)]
    a, b, c, d, e, k = inputs
    yes = five_antennas(a, b, c, d, e, k)
    print('Yay!' if yes 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):
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())
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):
d = []
d.append(int(input()))
d.append(int(input()))
d.append(int(input()))
d.append(int(input()))
d.append(int(input()))
k = int(input())

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

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

exists = False

for i in a:
    for j in a:
        if abs(i - j) > k:
            exists = True

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
L = [a,b,c,d,e]
flag = True
for i in range(4):
  for j in range(i,5):
    if abs(L[i]-L[j]) > k:
      flag = False
      break
if flag:
  print('Yay!')
else:
  print(':(')

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

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

Solution (Python):
from itertools import combinations
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
for p, q in combinations([a, b, c, d, e], 2):
    if abs(p - q) > 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())
ans='Yay!'
if e-a>k:
    ans=':('
print(ans)

Solution (Python):
def solve(l, k):
    for i in range(len(l)):
        for j in range(i+1, len(l)):
            if l[j]-l[i] > k:
                return True
    return False


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

    l = [a,b,c,d,e]
    if solve(l, k):
        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())

def asdf():
    if abs(a - b) > k: return False
    if abs(a - c) > k: return False
    if abs(a - d) > k: return False
    if abs(a - e) > k: return False
    if abs(b - c) > k: return False
    if abs(b - d) > k: return False
    if abs(b - e) > k: return False
    if abs(c - d) > k: return False
    if abs(c - e) > k: return False
    if abs(d - e) > k: return False
    return True

print("Yay!" if asdf() 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):
a=[int(input()) for i in range(5)]
k=int(input())
flag=1
for i in range(5):
    for j in range(i+1,5):
        if a[j]-a[i]>k:
            flag=0
            break
if flag:
    print('Yay!')
else:
    print(':(')

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

Solution (Python):

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


ok = True
for i in range(4):
    if a[i+1] - a[i] > k :
        ok = False
        break
if  a[4] - a[0] > k:
    print(":(")
else:
    print("Yay!")

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

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

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

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

a = sorted(a)
if abs(a[4] - a[0]) > k:
    print(':(')
else:
    print('Yay!')

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

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

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

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

a.sort()

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

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

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

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

if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    a = []
    for i in range(5):
      n = int(input())
      a.append(n)
    k = int(input())
    a.sort()
    for i in a:
      for j in a:
        if i == j:
          continue
        if abs(i-j) > k:
          return False
    return True

if __name__ == '__main__':
    if main():
      print("Yay!")
    else:
      print(":(")

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

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

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

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

Solution (Python):
ls = [int(input()) for i in range(5)]
k = int(input())
boo = False
for i in range(5):
    for j in range(5):
        if abs(ls[i] - ls[j]) > k:boo = True
if boo:print(':(')
else:print('Yay!')

Solution (Python):
import sys
from itertools import combinations

antena = [int(input()) for _ in range(5)]
k = int(input())
for a,b in combinations(antena, 2):
    if abs(a-b)>k:
        print(":(")
        break
else:
    print("Yay!")

Solution (Python):
antena = [int(input()) for i in range(5)]
k = int(input())
answer = "Yay!"
for i in range(5):
    now = antena[i]
    for j in range(i+1,5):
        sub = abs(now-antena[j])
        if sub > k:
            answer = ":("
    if answer != "Yay!":
        break
print(answer)

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

f = False
k  = int(input())
for a1 in an:
    for a2 in an:
        if abs(a1-a2) > k:
            f  =True
if f:
    print(":(")
else:
    print("Yay!")

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

Solution (Python):
from itertools import combinations
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

for (i,j) in combinations([a,b,c,d,e], 2):
    if(abs(i-j)>k):
        print(":(")
        exit()

print("Yay!")

Solution (Python):
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g


an = []

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

k = int(input())

flag = False
if (an[-1]-an[0] > k):
        flag = True

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

Solution (Python):
AE = [int(input()) for _ in range(5)]
k = int(input())
flag = True
for yy in AE:
    for xx in AE:
        if abs(xx-yy) > k:
            flag = False
if flag:
    print("Yay!")
else:
    print(":(")

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

Solution (Python):

import sys

YES = 'Yay!'
NO =  ':('

def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    if (b - a > k or c - b > k or d - c > k or e - d > k or 
       c - a > k or d - b > k or e - c > k or d > k or
       d - a > k or e - b > k or e - a > k):
        ret = NO
    else:
        ret = YES
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  
    b = int(next(tokens))  
    c = int(next(tokens))  
    d = int(next(tokens))  
    e = int(next(tokens))  
    k = int(next(tokens))  
    solve(a, b, c, d, e, k)

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
a=int(input())
input()
input()
input()
e=int(input())
k=int(input())
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())

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

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

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

Solution (Python):
def main(m, k):
    
    d = max(m) - min(m)
    if d > k:
        return ':('
    else:
        return 'Yay!'
    
if __name__ == '__main__':
    try:
        m = []
        for i in range(5):
            m.append(int(input().strip()))
        k = int(input().strip())
        print('{}'.format(main(m, k)))
    except EOFError:
        pass

Solution (Python):
*A, k = [int(input()) for _ in range(6)]

for ai in A:
    for aj in A:
        if abs(aj - ai) > k:
            print(":(")
            quit()
print("Yay!")

Solution (Python):
a = [int(input()), int(input()), int(input()), int(input()), int(input())]
k = int(input())

ok = True
for i in range(5):
    for j in range(5):
        if abs(a[i] - a[j]) > k:
            ok = False

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

Solution (Python):
a = int(input())
for _ in range(3):
    b = int(input())
e = int(input())
k = int(input())

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

Solution (Python):

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

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

Solution (Python):
import numpy as np
import sys

a = np.zeros(5)
for i in range(5):
    a[i] = int(input())

k = int(input())

r = a.max() - a.min() <= k
print("Yay!" if r 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())
_ = int(input())
_ = int(input())
_ = int(input())
b = int(input())
k = int(input())
if b-a<=k:
    print("Yay!")
else:
    print(":(")

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

Solution (Python):
import numpy as np

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

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

Solution (Python):
l= [int(input()) for i in range(5)]
l.sort()
if l[4] - l[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())
nums = []
nums.append(a)
nums.append(b)
nums.append(c)
nums.append(d)
nums.append(e)
ans = 0
for i in nums:
    for j in nums:
        if abs(i-j)>k:
            ans+=1
if ans==0:
    print("Yay!")
else:
    print(":(")

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

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

Solution (Python):
def solve():
  ABCDEF = [int(input()) for i in range(5)]
  K = int(input())
  return ':(' if max(ABCDEF) - min(ABCDEF) > K else 'Yay!'

print(solve())

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    A = [int(input()) for _ in range(5)]
    K = int(input())

    if A[4] - A[0] > K:
        return ':('
    else:
        return 'Yay!'


if __name__ == '__main__':
    print(main())

Solution (Python):

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

for i in range(5):
  for j in range(5):
    if abs(l[i] -l[j]) >k:
      print(":(")
      quit()
else:
  print("Yay!")

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

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

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

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

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

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

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

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

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

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

Solution (Python):

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

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

dist = int(input())
if abs(pos[0] - pos[-1]) > dist:
  print(":(")
else:
  print("Yay!")

Solution (Python):
import sys
from itertools import permutations

inputs = []

for _ in range(5):
    inputs.append(int(sys.stdin.readline()))
k = int(sys.stdin.readline())


flag = True
for i, j in permutations(inputs, 2):
    if abs(i - j) > k:
        flag = False
        break

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

Solution (Python):
l = list(int(input()) for _ in range(5))
k = int(input())

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline




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


	
if __name__ == "__main__":
	main()

Solution (Python):


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

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


if __name__ == '__main__':
    main()

Solution (Python):
def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int,ss_raw()))


poss = []
for i in range(5):
    p = int_raw()
    poss.append(p)
k = int_raw()

def main():
    for i in range(5):
        for j in range(i):
            if abs(poss[i]-poss[j])>k:
                return ":("
    return "Yay!"

print(main())

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

Solution (Python):

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

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

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

Solution (Python):
l = []

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

k = int(input())
l.sort()

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

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

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

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

Solution (Python):
import itertools

a = [int(input()) for i in range(5)]
k = int(input())
flag = 1
for i in itertools.combinations(a, 2):
    if abs(i[0] - i[1]) > k:
        flag = 0
if flag:
    print("Yay!")
else:
    print(":(")

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

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

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

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

Solution (Python):
mina, maxa = 130, 0
for _ in range(5):
  a = int(input())
  mina = min(a, mina)
  maxa = max(a, maxa)

k = int(input())
if maxa - mina > k:
  print(':(')
else:
  print('Yay!')

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

Solution (Python):
A = list(int(input()) for _ in range(5))
K = int(input())
ans = 'Yay!'
for i in range(5):
    for j in range(5):
        if not  - K <= A[i] - A[j] <= K:
            ans = ':('
print(ans)

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

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

Solution (Python):
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
flag = True
for i in range(4):
    for j in range(i+1, 5):
        if abs(a[j]-a[i]) >k:
            flag= False
            break
if flag:
    print('Yay!')
else:
    print(':(')

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

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

print(output)

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

if b-a >k:
  print(":(")
  exit()
if c-b >k:
  print(":(")
  exit()
if d-c >k:
  print(":(")
  exit()
if e-a >k:
  print(":(")
  exit()
print("Yay!")

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