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):
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):
ant =[]
ind = 0

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

for i in range(5):
    for j in range(i,5):
        if ant[j] - ant[i] > k:
            ind += 1
if ind <= 0:
    print('Yay!')
else:
    print(':(')

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

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

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

flgs = [abs(antennas[i] - antennas[j]) <= k
             for i in range(len(antennas)-1) 
             for j in range(i+1,len(antennas))
            ]

print("Yay!" if all(flgs) else ":(")

Solution (Python):
import numpy as np

import sys
sys.setrecursionlimit(1000000)

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(c-d) > k or abs(c-e) > k or abs(d-e) > k:
    print (":(")
else:
    print ("Yay!")

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

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

flag = 1

aa=[]
aa.append(a)
aa.append(b)
aa.append(c)
aa.append(d)
aa.append(e)

for i in range(5):
    for j in range(5):
        if (aa[i]-aa[j]>k) or (aa[i]-aa[j]<-1*(k)):
            flag = 0

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

t=e-a

if t > k:
	print(':(')
else:
	print('Yay!')

Solution (Python):
a  = list()
for i in range(0,6):
    a.append(int(input()))

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

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

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

Solution (Python):
import sys
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(":(")
            sys.exit()
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):
S=[]
for i in range(5):
    S.append(int(input()))
k=int(input())

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

Solution (Python):
a = 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())

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

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

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

line=[b-a,c-b,d-c,e-d,c-a,d-b,e-c,d-a,e-b,e-a]

if max(line)>k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
lis = []
count = 0

for i in range(5):
  a = int(input())
  lis.append(a)
  
k = int(input())
for x in lis:
  for y in lis:
    if x-y>k:
      count += 1
      
if count != 0:
  print(':(')
else:
  print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
abc = [a,b,c,d,e]
ans = 0
flag = 0
for i in range(5):
    for j in range(i,5):
        ans = abc[j]-abc[i]
        if ans <= k:
            continue
        else:
            flag = 1
            break
if flag == 1:
    print(':(')
else:
    print('Yay!')

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

ans = 'Yay!'
for i in range(5):
    for j in range(5):
        if abs(a[i] - a[j]) > k:
            ans = ':(' 

print(ans)

Solution (Python):
def main():
  ps = list(map(int, [input() for _ in range(5)]))
  k = int(input())
  for i in range(len(ps)):
    for j in range(i, len(ps)):
      if abs(ps[i] - ps[j]) > k:
        print(':(')
        return
  print('Yay!')
  
main()

Solution (Python):

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

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

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

f = True
for A, B in itertools.combinations(a, 2):
    if abs(A - B) > k:
        f = False

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

Solution (Python):
dis = [int(input()) for i in range(5)]
k = int(input())
if (dis[-1]-dis[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(':(')
    exit()

if e - b > k:
    print(':(')
    exit()

if e - c > k:
    print(':(')
    exit()

if e - d > k:
    print(':(')
    exit()

if d - a > k:
    print(':(')
    exit()

if d - b > k:
    print(':(')
    exit()

if d - c > k:
    print(':(')
    exit()

if c - a > k:
    print(':(')
    exit()
if c - b > k:
    print(':(')
    exit()
if b - a > k:
    print(':(')
    exit()
print('Yay!')

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


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

dis = int(input())

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

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

for i in range(5):
    for j in range(i+1, 5):
        if a[j] - a[i] > k:
            ans = False
            break
    if not ans:
        break

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

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

Solution (Python):
minl = int(input())
maxl = minl
for i in range(4):
  a = int(input())
  minl = min(minl, a)
  maxl = max(maxl, a)
k = int(input())
print('Yay!' if maxl - minl <= k else ':(')

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A=[INT() for i in range(5)]
K=INT()

if max(A)-min(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):
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):
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):
list=[]
ans=0
for i in range(5):
    list.append(int(input()))
k=int(input())
for i in range(5):
    for j in range(i-1):
        if abs(list[i]-list[j])>ans:
            ans=abs(list[i]-list[j])
if ans>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 b-a<=k and c-a<=k and d-a<=k and e-a<=k:
    if c-b<=k and d-b<=k and e-b<=k:
        if d-c<=k and e-c<=k:
            if e-d<=k:
                print("Yay!")
            else:
                print(":(")
        else:
            print(":(")
    else:
        print(":(")
else:
    print(":(")

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

l.sort()

is_ok = True
for i in range(5):
    for j in range(5):
        if abs(l[i] - l[j]) > k:
            is_ok = False 
            break
    if is_ok == False:
        break

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

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

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

lis.sort()

if lis[4]-lis[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()) for i in range(5)]
k = int(input())
result = 0
for i in range(5):
    p = a[i]
    for j in range(4):
        q = a[j]
        if a != j and abs(p - q) > k:
            result = 1
if result == 1:
    print(':(')
else:
    print('Yay!')

Solution (Python):
import sys
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
A = [a, b, c, d, e]
if max(A) - min(A) > k:
    print(":(")
    sys.exit(0)
print("Yay!")

Solution (Python):



from itertools import combinations

import sys

X = []
for _ in range(5):
    X.append(int(input()))
K = int(input())
    
for a, b in combinations(X, 2):
    if abs(a - b) > 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())

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

if k < max-min:
    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])
if (f-g)>k:
    print(':(')
else:
    print('Yay!')

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

check = 0
if abc[4] - abc[0] > k:
    check = 1

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

Solution (Python):

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

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

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

Solution (Python):
import sys
import io
import math
import re

datalist = input().split()
data_a = int(datalist[0])
datalist = input().split()
datalist = input().split()
datalist = input().split()
datalist = input().split()
data_b = int(datalist[0])
datalist = input().split()
data_c = int(datalist[0])

if data_b -data_a <= data_c:
  print('Yay!')
else:
  print(':(')

Solution (Python):
p=[int(input())for _ in range(5)]
l=int(input())
for s in p[::-1]:
  if s-p[0]>l:
    print(':(');exit()
print('Yay!')

Solution (Python):
a = int(input())

for i in range(4):
	b = int(input())

k = int(input())

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

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

Solution (Python):
min_n = 124
max_n = -1

for _ in range(5):
    temp = int(input())
    min_n = min(min_n,temp)
    max_n = max(max_n,temp)

distance = int(input())
if max_n-min_n > distance:
    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())
judge = all([abs(i1 - i2) <= k for (i1, i2) in list(itertools.combinations([a,b,c,d,e],2))])
if judge:
    print('Yay!')
else:
    print(':(')

Solution (Python):


import sys
input = sys.stdin.readline

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

k = int(input())

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

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

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

flag = 'Yay!'
antenas = [a, b, c, d, e]
for i in range(5):
    for j in range(i, 5):
        if abs(antenas[i] - antenas[j]) > k:
            flag = ':(' 

print(flag)

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 = []
for i in range(5):
    A.append(int(input()))
k = int(input())
maxA = max(A)
minA = min(A)
lenA = maxA - minA
if lenA <= 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 and abs(a - c) <= k and abs(a - d) <= k and abs(a - e) <= k and abs(b - c) <= k and abs(b - d) <= k and abs(b - e) <= k and abs(c - d) <= k and abs(c - e) <= k and abs(d - e) <= 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):
import itertools


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

points = list()
points.append(a)
points.append(b)
points.append(c)
points.append(d)
points.append(e)

def is_com_all(points):
    for idx_1, idx_2 in itertools.combinations(range(5), 2):
        if points[idx_2] - points[idx_1] > k:
            return False
    
    return True

if is_com_all(points):
    print('Yay!')
else:
    print(':(')

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

ans = 'Yay!'
for i in range(5):
    for j in range(5):
        if i < j:
            if L[j]-L[i] > k:
                ans = ':('
print(ans)

Solution (Python):
if __name__ == '__main__':
    A, B, C, D, E, K = int(input()), int(input()), int(input()), int(input()), int(input()), int(input())
    AB, AC, AD, AE = B-A, C-A, D-A, E-A
    BC, BD, BE = C-B, D-B, E-B
    CD, CE = D-C, E-C
    DE = E-D
    if max(AB, AC, AD, AE, BC, BD, BE, CD, CE, DE) <= K:
        print("Yay!")
    else:
        print(":(")

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

Solution (Python):


def io_generator():
	return input()



def main(io):
	l =[ int(io()) for _ in range(5)]
	k=int(io())
	return ret((l[-1] - l[0]) <= k)

def ret(isOk):
	return 'Yay!' if isOk else ':('



if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Solution (Python):
a=[]
for i in range(5):
  a.append(int(input()))
k=int(input())
print(["Yay!",":("][max(a)-min(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):
list = [int(input()) for _ in range(5)]
k = int(input())
flag = True
for i in range(5):
    for j in range(5):
        if list[i] - list[j] > 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):
a, b, c, d, e, k = [int(input()) for _ in range(6)]

ans = True
if e-a>k:
    ans = False

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

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

k=int(input())

if a[4]-a[0]>k:
    s=0

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

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

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    A = []
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))

    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    A.append(int(input_raw[0]))
    input_raw = read_func().strip().split()
    k = int(input_raw[0])

    if A[len(A) - 1] - A[0] > k:
        print ":("
        return
    print "Yay!"


if __name__ == '__main__':
    main()

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

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

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

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

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


k=int(input())

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

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

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

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

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

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

Solution (Python):
li = list()
for i in range(5):
  li.append(int(input()))
k = int(input())
ans = False

for i in li:
  for a in li:
    if abs(i-a) > k:
      ans = True
      break;
if ans:
  print(':(')
else:
  print("Yay!")

Solution (Python):
ant = []
for i in range(5):
    ant0 = int(input())
    ant.append(ant0)
k = int(input())
if ant[1] - ant[0] > k:
    print(':(')
elif ant[2] - ant[0] > k:
    print(':(')
elif ant[3] - ant[0] > k:
    print(':(')
elif ant[4] - ant[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())

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

for i in range(len(list)):
    for j in range(i,len(list)):
        if list[j] - list[i] > k :
            print(':(')
            exit()

print('Yay!')

Solution (Python):
l=[]
for i in range(5):
    l.append(int(input()))
k=int(input())
flag=True
for i in l:
    for j in l:
        if abs(i-j)>k:
            flag=False
        
if flag==False:
    print(":(")
else:
    print("Yay!")

Solution (Python):
s=list(map(int,open(0).read().split()))
if s[4] - s[0] > s[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 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())

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

min_an = min(an_list)
max_an = max(an_list)

if abs(min_an-max_an) <= 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 (d - e > k):
    print(":(")

else:
    print("Yay!")

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

d = e - a
k = int(input())

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

Solution (Python):

A = [int(input()) for _ in range(5)]
k = int(input())
flag = True
for i in range(5):
    for b in A[i:]:
        if b - A[i] > 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())

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

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

ans = True
for ai in a:
    if a[4] - ai > k:
        ans = False
        break

if not ans: print( ':(' )
else:   print( 'Yay!' )

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

Solution (Python):

n = [int(input()) for _ in range(6)]
flg = True
for i in range(4):
    for j in range(4 - i):
        if n[j + 1] - n[i] > n[5]:
            flg = False
print([':(', 'Yay!'][flg])

Solution (Python):
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

arr = sorted([read_int()[0] for _ in range(5)])
k = read_int()[0]

if __name__ == "__main__":
    if arr[4] - arr[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):
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
    
a.sort()
if a[4]-a[0] > k:
    print(':(')
else:
    print('Yay!')

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

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

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

if 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())
def solve():
    length = [a,b,c,d,e]
    length.sort()
    if(length[-1]-length[0]>k):
        return print(':(')
    return print('Yay!')
solve()

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

if max(num) - min(num) >num[5]:
  print(":(")

else:
  print("Yay!")

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return int(stdin.readline())

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

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

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

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

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

    B = A.copy()
    for i in range(5):
        for j in range(i, 5):
            if B[j]-A[i] > k:
                return ':('
    return 'Yay!'

print(m())

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

    antennas = [a, b, c, d, e]
    max_val = max(antennas)
    min_val = min(antennas)

    if max_val - min_val > 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())

if (
        b - a <= k and
        c - a <= k and
        d - a <= k and
        e - a <= k and
        c - b <= k and
        d - b <= k and
        e - b <= k and
        d - c <= k and
        e - c <= k and
        d - e <= k
):
    print('Yay!')
else:
    print(':(')

Solution (Python):
from functools import reduce

def main():
    
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    a = int(input().rstrip())
    b = int(input().rstrip())
    c = int(input().rstrip())
    d = int(input().rstrip())
    e = int(input().rstrip())
    k = int(input().rstrip())
    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!')
        
if __name__ == '__main__':
    main()

Solution (Python):
import math
import copy
from collections import Counter
from _ast import Or
 
 
 
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:
 
            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
 

a=nCast(inputArr(5))
b=int(input())

                   
   

def func():
    global a
    for idx in range(len(a)):
        for idy in range(idx+1,len(a)):
            k=a[idx]-a[idy]
            if(b<abs(k)):
                return ":("
    return "Yay!"
print(func())

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

antena = [a,b,c,d,e]
flag = 0
for i in range(len(antena)):
  for j in range(len(antena)):
    if abs(antena[i] - antena[j]) > k: flag = 1
      
if flag == 1:
  print(":(")
else:
  print("Yay!")

Solution (Python):
list=[]

for i in range(5):
    x=int(input())
    list.append(x)
k=int(input())
ok_swit=1

for a in range(5):
    for b in range(4-a):
        c=a+b+1
        if abs(list[a]-list[c])>k:
            ok_swit=0

if ok_swit==1:
    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())

l = [a, b, c, d, e]
def main():
    for i in range(0, 4):
        for j in range(i+1, 5):
            if l[j] - l[i] > k:
                print(":(")
                return
    print("Yay!")

main()

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

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

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

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