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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

from itertools import combinations

for a1, a2 in combinations(antennas, 2):
    if abs(a1 - a2) > k:
        print(':(')
        break
else:
    print('Yay!')

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:
# coding:utf-8
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
# A,B,C,D,Eの順で並んでいる
# 条件的にAとEが一番遠いので、それがk以上だったらアウト
if (e-a > k):
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(5)]
m=int(input())
s=0
for i in range(5):
    for k in range(5):
        n=a[k]-a[i]
        if n>m:
            s+=1
if s!=0:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a=[0]*6
for i in range(6):
    a[i]=int(input())
if a[4]-a[0] > a[5]:
    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='Yay!'
A=[a,b,c,d,e]
for i in A:
    for j in A:
        if abs(i-j)>k:
            ans=':('
print(ans)

Submission status: Accepted

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

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

print(output)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = []

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

Submission status: Accepted

Solution code:
a = []
y = []

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

c =itertools.combinations(a,2)

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

m = 0

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

Submission status: Accepted

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


print(ans)

Submission status: Accepted

Solution code:
import itertools

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

k = int(input())

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力




args = []
for _ in range(5):
    tmp = int(input())
    args.append(tmp)
k = int(input())
for i in range(5):
    for j in range(i+1, 5):
        if i == j:
            continue
        dis = args[j] - args[i]
        if dis > k:
            print(':(')
            exit()
print('Yay!')

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

Submission status: Accepted

Solution code:
#five antennas

#入力
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

antennas=[a,b,c,d,e]
#判定

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

Submission status: Accepted

Solution code:
import sys, os

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

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

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

Submission status: Accepted

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

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import sys

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

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

print 'Yay!'

Submission status: Accepted

Solution code:
import itertools

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

v = (a, b, c, d, e)
if all(abs(v1 - v2) <= k for v1, v2 in itertools.product(v, repeat=2)):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

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

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

Main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

#for i,lines in enumerate(lines):
#	lines = lines.strip("\n")

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

D = True

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
def main():
    _min, _max = 123, 0
    for _ in range(5):
        i = int(input())
        if _min > i:
            _min = i
        if i > _max:
            _max = i
    k = int(input())

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n
# def zeros(n): return np.zeros(n, dtype=np.longlong)
def zeros2(n, m): return [zeros(m) for i in range(n)] # obsoleted zeros((n, m))で代替

INF = 10**18

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

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

ans = prob()
print(ans)

Submission status: Accepted

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

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

print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
*a,k=[int(input()) for i in range(6)]
for i in a:
    if i-a[0]>k:
        print(":(")
        break
else:
    print("Yay!")

Submission status: Accepted

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

k = int(input())

list_mutual_distance = []


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

max_distance = max(list_mutual_distance)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = 6 #the number of the input data
a = [[int(i) for i in input().split()] for j in range(N)]

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

Submission status: Accepted

Solution code:
# a~e,kを定義
a, b, c, d, e, k = int(input()), int(input()), int(input()), int(input()), int(input()), int(input())
# 条件に合わせて出力
if e - a > k :
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

if ma-mi <= k:
    print("Yay!")
else:
    print(":(")

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A
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:
l=[]
for i in range(6):
    l.append(int(input()))
#print(l)
if l[4]-l[0]<=l[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("Yay!")
else:
  print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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


for arg1 in args[:5]:
    for arg2 in args[1:5]:
        if (arg2 - arg1) > args[5]:
            print(":(")
            sys.exit()
print("Yay!")

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

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

Submission status: Accepted

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

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

isConnection = True

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

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

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

Submission status: Accepted

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

i0 = int(i[0])

i1 = int(i[1])

i2 = int(i[2])

i3 = int(i[3])

i4 = int(i[4])

i5 = int(i[5])



if  i4 - i0 > i5:
    print(":(")

else:
    print("Yay!")

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(5)]
K = int(input())

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

Submission status: Accepted

Solution code:
#変数の初期化
a = 0
antennas = []
k = 0
flg = True

#入力を受け付ける
a = int(input())
for i in range(4):
    antennas.append(int(input()))
k = int(input())

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

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

Submission status: Accepted

Solution code:
import itertools

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

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

main()

Submission status: Accepted

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

print("Yay!")

Submission status: Accepted

Solution code:
*Pos, K = [int(input()) for _ in range(6)]
print('Yay!' if Pos[4] - Pos[0] <= 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:
# Enter your code here. Read input from STDIN. Print output to STDOUT

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

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

Submission status: Accepted

Solution code:
A = [int(input()) for i in range(5)]
k = int(input())
flag = True
for i in range(5):
    for j in range(i+1,5):
        if A[j] - A[i] > k:
            flag = False
if flag == True:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = []

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

f = a[-1] - a[0] <= int(input())

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
D = "Yay!"
antena = [a,b,c,d,e]
for st in range(5):
  for end in  range(st+1,5):
    if abs(antena[st] - antena[end]) > k:
      D = ":("
print(D)

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

Submission status: Accepted

Solution code:
*A, k = [int(input()) for _ in range(6)]
if abs(A[0] - A[-1]) > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
*a, k = map(int, open(0).read().split())
for i in range(5):
    for j in range(5):
        if i == j:
            continue
        if abs(a[j] - a[i]) > k:
            print(":(")
            exit()
print("Yay!")

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

print('Yay!' if max(l) - min(l) <= k else ':(')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

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

input = [a, b, c, d, e]
a = list(itertools.combinations(input, 2))
a = [True if (b - a) <= k else False for (a, b) in a]

if False in a:
  	print(':(')
else:
	print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
*Pos, K = [int(input()) for _ in range(6)]
for s in range(5):
  for t in range(s + 1, 5):
    if Pos[t] - Pos[s] > K:
      print(':(')
      exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

bl = max(v) - min(v) <= k
print('Yay!' if bl else ':(')

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

loops1 = 4
loops2 = 5
arg1 = 0
arg2 = 1

i=0
j=0

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

for i in range(arg1,loops1):
	for j in range(arg2,loops2):
		if (args[j] - args[i]) > args[5]:
			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(":(")
else:
    print("Yay!")