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 :(.



Sample input:
1
2
4
8
9
15


Sample output:
Yay!

Submission status: Accepted

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

flag = False
K = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=list(int(input())for i in range(5))
k=int(input())
dis=max(A)-min(A)
print("Yay!") if dis<=k else print(":(")

Submission status: Accepted

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

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

print ("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import itertools

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

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

k = int(input())

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

Submission status: Accepted

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

k = int(input())

diff = 0

ant_list = []

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

judge = True

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

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=min(a,b,c,d,e)
g=max(a,b,c,d,e)
h=g-f
if h <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
antenna = [0]*5
for i in range(5):
    antenna[i] = int(input())

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from itertools import combinations

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

com = [True if antennae[j] - antennae[i] <= k else False for i, j in combinations(range(5), 2)]
if sum(com) == len(list(combinations(range(5), 2))):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
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(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i1 = []
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i1.append(int(input()))
i2 =(int(input()))
#print(i1)
 
for i in i1:
  for n in i1:
    if abs(i - n) > i2:
      ans = ':('
      break
    else:
      ans = 'Yay!'
      
print(ans)

Submission status: Accepted

Solution code:
#a,b=map(int,input().split())
#print(max(2*a-1,a+b,2*b-1))

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

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

Submission status: Accepted

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

o=int()

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

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

Submission status: Accepted

Solution code:
import sys
 
antennas = [int(input()) for _ in range(5)]
k = int(input())
 
for p in range(5):
  for q in range(p+1,5):
    if antennas[q] - antennas[p] > k:
      print (':(')
      sys.exit()

print ('Yay!')

Submission status: Accepted

Solution code:
abcde = []
for i in range(5):
    abcde.append(int(input()))
k = int(input())
for i in range(5):
    for j in range(5):
        if abcde[i]-abcde[j] > k :
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for i in ak:
    for k in ak:
        if (i - k) > ranger:
            print(":(")
            sys.exit()
print("Yay!")

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e-a>k:
    print(":(")

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

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

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

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

else:
    print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
ls = []
for i in range(5):
    ls.append(int(input()))
k = int(input())
if ls[4]-ls[0] <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
from itertools import permutations

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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!')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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!')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
c = [int(input()) for i in range(5)]
k = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
P = [int(input()) for _ in range(5)]
k = int(input())

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
lst = []

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

k = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = (e - a) > k

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

Submission status: Accepted

Solution code:
import sys

nums = []

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

k = int(input())

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

print("Yay!")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ren = max(an)-min(an)

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

Submission status: Accepted

Solution code:
# ABC123A - Five Antennas
lst = list(map(int, [input() for _ in range(5)]))
k = int(input())

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

Submission status: Accepted

Solution code:
# ABC123A - Five Antennas
lst = list(map(int, [input() for _ in range(5)]))
k = int(input())
answer = "Yay!"
count = 0

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

print(answer)

Submission status: Accepted

Solution code:
# ABC123A - Five Antennas
lst = list(map(int, [input() for _ in range(5)]))
k = int(input())
answer = "Yay!"
count = 0

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

Submission status: Accepted

Solution code:
input0 = int(input())
input1 = int(input())
input2 = int(input())
input3 = int(input())
input4 = int(input())
K = int(input())

list = (input0,input1,input2,input3,input4)
max = max(list)
min = min(list)
fig = max - min

if fig <= K :
    print ("Yay!")
else :
    print (":(")

Submission status: Accepted

Solution code:
a = []
for i 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(":(")
      exit()
 
print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

def check(one, two, k):
	if abs(one - two) <= k:
		return 0
	else:
		return 1

cnt = 0

if check(a,b,k) == 1:
	cnt += 1
if check(a,c,k) == 1:
	cnt += 1
if check(a,d,k) == 1:
	cnt += 1
if check(a,e,k) == 1:
	cnt += 1
if check(c,b,k) == 1:
	cnt += 1
if check(d,b,k) == 1:
	cnt += 1
if check(e,b,k) == 1:
	cnt += 1
if check(c,d,k) == 1:
	cnt += 1
if check(c,e,k) == 1:
	cnt += 1
if check(d,e,k) == 1:
	cnt += 1
if check(a,b,k) == 1:
	cnt += 1
if cnt >= 1:
	print(":(")
else:
	print("Yay!")

Submission status: Accepted

Solution code:
li = [int(input()) for _ in range(5)]  # li = ['hoge', 'bar', 'foo']
k = int(input())

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

Submission status: Accepted

Solution code:
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!")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
Coordinate=[0]*5
for i in range(5):
    Coordinate[i]=int(input())
k=int(input())
ans=True
for i in range(5):
    for j in range(5):
        if abs(Coordinate[i]-Coordinate[j])>k:
            ans=False
if ans==True:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
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":(")

Submission status: Accepted

Solution code:
antenna = [int(input()) for _ in range(5)]
k = int(input())

# 一番遠い組だけ調べる
if antenna[-1] - antenna[0] <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
locs = [int(input()) for _ in range(5)]
k = int(input())
flag = False

for i in range(5-1):
    for j in range(i+1,5):

        if locs[j] - locs[i] > k:
            print(':(')
            flag = True
            break
    
    if flag:
        break

if not flag:
    print('Yay!')

Submission status: Accepted

Solution code:
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(":(")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# 整数の入力
# 整数の入力
antena = []
ans = "Yay!"

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

k = int(input())

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

# 出力
print("Yay!")

Submission status: Accepted

Solution code:
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!')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=[0]*5
for i in range(5):
    s[i]=int(input())
k=int(input())
ans='Yay!'
for i in range(4):
    if s[4]-s[i]>k:
        ans=':('
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
antenas = [int(input()) for i in range(5)]
k = int(input())
if k == 0:
    print('Yay!')
    exit()
print('Yay!') if max(antenas) - min(antenas) <= k else print(':(')

Submission status: Accepted

Solution code:
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!')

Submission status: Accepted

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

Submission status: Accepted

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

# アンテナと距離に分ける
i = [a[0], a[1], a[2], a[3], a[4]]
k = a[5]

flag = False
itr = 0
while True:
  x = itr
  while True:
    x+=1
    if x >= 5:
      break
    elif(i[x] - i[itr]) > k:
      flag = True
  itr+=1
  if itr == 5:
    break
    
if flag:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc123
# -*- coding: utf-8 -*-

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

k = int(input())

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

Submission status: Accepted

Solution code:
a,b,c,d,e,k = (int(input()) for i in range(6))

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
a,b,c,d,e = [ int(stdin.readline().rstrip()) for _ in range(5) ]
k = int(stdin.readline().rstrip())
if ( e - a ) > k :
    print(":(")
    sys.exit()
print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

b = int(input())

c = 0
count = 0
# print(a, b)

for i in a:
    for j in a:
        c = j - i

        if c > b:
            count += 1

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

Submission status: Accepted

Solution code:
from itertools import combinations

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

for i, j in combinations(s, 2):
    if k < abs(i - j):
        print(":(")
        exit()
print("Yay!")

Submission status: Accepted

Solution code:
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( ":("  )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
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!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = [int(input()) for i in range(5)]
k = int(input())

flag = 1

for i in range(5):
    for j in range(5):
        if abs(li[i] - li[j]) > k:
            flag = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
*a, = map(int, open(0).read().split())
k = a.pop()
#print(a,k)
c = 'Yay!'
for i in a:
    for j in a:
        if j-i > k:
            c = ':('
            break
print(c)

Submission status: Accepted

Solution code:
t = [int(input()) for i in range(6)] 

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

Submission status: Accepted

Solution code:
s = [int(input()) for i in range(6)]
result = True
for i in range(5):
    for j in range(i+1, 5):
        if s[j] - s[i] > s[5]:
            result = False
            break

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

Submission status: Accepted

Solution code:
nums = []
for i in range(5):
    nums.append(int(input()))
k = int(input())
s = "Yay!"
for i in range(5):
    for m in range(5 - i):
        a = nums[i]
        if abs(a - nums[m]) > k:
             s = ":("
             break
print(s)

Submission status: Accepted

Solution code:
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 ":(")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
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!")

Submission status: Accepted

Solution code:
input_nums = []
input_count = 5

for i in range(0,input_count):
  input_nums.append(int(input()))

allowed_distance = int(input())

for i in range(0,input_count):
  for j in range(i+1,input_count):
    #print('i:',i,'j:',j)
    if (input_nums[j] - input_nums[i]) > allowed_distance:
      print(':(')
      exit()

print('Yay!')

Submission status: Accepted

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

k = int(input())

ae_length = e-a

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = []
b = []
for i in range(5):
    a.append(int(input()))
k = int(input())
for i in range(len(a)):
    for j in range(len(a)):
        ans = abs(a[i] - a[j])
        b.append(ans)
        
for i in b:
    if k < i:
        print(":(")
        exit()
print('Yay!')

Submission status: Accepted

Solution code:
nums = [int(input()) for _ in range(5)]
k = int(input())

def anthennas(nums, k):
  if nums[-1] - nums[0] <= k:
      return "Yay!"
  return ":("
  
  
print(anthennas(nums, k))

Submission status: Accepted

Solution code:
import sys

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

k = int(input())

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

print('Yay!')