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:
import itertools
anthena = [int(input())for _ in range(5)]
k = int(input())
ans = "Yay!"
for i,j in itertools.combinations(anthena,2):
  if abs(i - j) > k:
    ans = ":("
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

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:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    l=[int(input()) for i in range(5)]
    k=int(input())
    f=True
    for i in l:
        for j in l:
            if abs(i-j) >k:
                f=False      
    print('Yay!' if f == True else ':(')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = [int(input()) for i 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 = 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:
l = []
for i in range(6):
   l.append(int(input()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,*_,e,k=map(int,open(0))
print([":(","Yay!"][e-a<=k])

Submission status: Accepted

Solution code:
l=list(int(input()) for _ in range(5))
m=int(input())
print([":(","Yay!"][l[4]-l[0]<=m])

Submission status: Accepted

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

#print(l, k)

for i in range(5):
  for j in range(5):
    if abs(l[i] - l[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())
if b - a > k:
    print(":(")
elif c - a > k:
    print(":(")
elif d - a > k:
    print(":(")
elif e - a > k:
    print(":(")
elif c - b > k:
    print(":(")
elif d - b > k:
    print(":(")
elif e - b > k:
    print(":(")
elif d - c > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > 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())

count = 0
antena = [a,b,c,d,e]

for i in antena:
    for j in antena:
        if abs(i - j) <= k:
            count += 1

if count == 25:
    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())
nums = [a, b, c, d, e]
ans = 'Yay!'
for i in range(0, 5):
    for j in range(0, 5):
        src = abs(nums[i] - nums[j])
        if src > k:
            ans = ':('
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
at = [int(input()) for x in range(5)]
k = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(6)]
if a[4]-a[0] <= a[5]:
    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())
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 max(k,b-a,c-a,d-a,e-a,c-b,d-b,e-b,d-c,e-c,e-d)==k:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
A = [int(input()) for i in range(5)]
k = int(input())
ans = 0
for i in range(5):
    for x in range(i,5):
        if A[x] - A[i] > k:
            ans = ans + 1
if ans > 0:
    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 b-a > k or c-a > k or d-a > k or e-a > k or e-d > k or e-c > k or e-b > k or 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())

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

Submission status: Accepted

Solution code:
a,b,c,d,e,k=[int(input()) for i in range(6)]
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())
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=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:
l=[int(input()) for i in range(5)]
a,c=min(l),max(l)
k=int(input())
print("Yay!") if (a-c)**2<=k**2 else print(":(")

Submission status: Accepted

Solution code:
# 2019-11-12 22:40:44(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    *antennas, k = [int(x) for x in sys.stdin.read().split()]
    if antennas[-1] - antennas[0] > k:
            print(':(')
            sys.exit()
    print('Yay!')

if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=[]
b=[]

for i in range(0,6):
  a.append(int(input()))
ans=0
for j in range(0,4):
  for k in range(j+1,5):
    if a[k]-a[j]>a[5]:
      ans+=1
    
if ans==0:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
lists=[]
for i in range(5):
  nums=int(input())
  lists.append(nums)
dis=int(input())
lists=sorted(lists)
if lists[-1]-lists[0]<=dis:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

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

#diff = [a-b,b-c,c-d,d-e]

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

print(ret)

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:
d=[int(input()) for i in range(5)]
k=int(input())
count=0

for i in d:
  for j in d:
    if abs(i-j)>k:
      count=1

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

check = 0

for i in moji_list:
  for j in moji_list:
    if abs(i-j) > k:
      check = 1
      
if check == 0:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
# ABC 123: A – Five Antennas
import sys

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

for i in [a, b, c, d, e]:
    for j in [a, b, c, d, e]:
        if j - i > k:
            can_directly = False

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

Submission status: Accepted

Solution code:
from itertools import combinations

l = [int(input()) for i in range(6)]
k = l.pop()
if any(abs(i[0]-i[1])>k for i in combinations(l,2)):
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p=[]
for i in range(5):
  p+=[int(input())]
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())
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:
array = [];
ans = 0;

for i in range(6):
    array.append(int(input()));

if abs(array[0] - array[1]) > array[5]: ans += 1;
if abs(array[0] - array[2]) > array[5]: ans += 1;
if abs(array[0] - array[3]) > array[5]: ans += 1;
if abs(array[0] - array[4]) > array[5]: ans += 1;

if abs(array[1] - array[2]) > array[5]: ans += 1;
if abs(array[1] - array[3]) > array[5]: ans += 1;
if abs(array[1] - array[4]) > array[5]: ans += 1;

if abs(array[2] - array[3]) > array[5]: ans += 1;
if abs(array[2] - array[4]) > array[5]: ans += 1;

if abs(array[3] - array[4]) > array[5]: ans += 1;

if ans == 0: print("Yay!");
else: print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    array = [int(input()) for _ in range(6)]
    k = array[-1]
    array = array[:-1]

    minimum = min(array)
    maximum = max(array)
    if maximum-minimum > k:
        print(':(')
        return
    print('Yay!')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

li = [int(stdin.readline().rstrip()) for _ in range(5)]
k = int(stdin.readline().rstrip())

from itertools import combinations
lin = list(combinations(li, 2))

for i in range(len(lin)):
    if abs(lin[i][0]-lin[i][1]) > k:
        print(":(")
        exit()

print("Yay!")

Submission status: Accepted

Solution code:
l = []
ans = 'Yay!'
for i in range(5):
  l.append(int(input()))
k = int(input())
for i in range(4):
  for j in range(i+1, 5):
    if abs(l[i] - l[j]) > k:
      ans = ':('
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

flag = True
for i in range(5):
  for j in range(i+1, 5):
    dist = ass[j] - ass[i]
    if dist > k:
      flag = False
      
if flag:
  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())
ant_list=[a,b,c,d,e]
ant_list.sort()
if (ant_list[-1]-ant_list[0])<=k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(4):
    for j in range(i+1,5):
        if abs(l[i]-l[j]) > k:
            print(':(')
            exit()

print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

print("Yay!" if max(l) - min(l) <= 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(""))
M=max(a,b,c,d,e)
m=min(a,b,c,d,e)
sa=M-m
if sa<=k:
    print('Yay!')
else:
    print(':(')

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

k=int(input())

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

Submission status: Accepted

Solution code:
li=[]
for n in range(5):
    li.append(int(input()))
li.sort()
k=int(input())
if li[4]-li[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 e-a > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=[]
for i in range(5):
    A.append(int(input()))
k=int(input())
ans='Yay!'
for j in range(5):
    for l in range(j,5):
        if abs(A[j]-A[l])>k:
            ans=':('
print(ans)

Submission status: Accepted

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

x = X[4] - X[0]

if x > X[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())

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(5):
	for j in range(i, 5):
		if inp[j] - inp[i] > k:
			print(":(")
			exit(0)
print("Yay!")

Submission status: Accepted

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

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

    for antena in antenas:
        for antena2 in antenas:
            if (antena - antena2)>k:
                print(':(')
                return

    print('Yay!')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d,e,k = [int(input()) for _ in range(6)]
print(':(' if e-a>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 = max(a,b,c,d,e) - min(a,b,c,d,e)

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

Submission status: Accepted

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

k = int(input())
ans = max(diff_L)-min(diff_L)

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = []
for _ in range(5):
    a.append(int(input()))
k = int(input())
for i in range(5):
    for j in a[i+1:]:
        if abs(a[i]-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())
ans1 = ("Yay!")
ans2 = (":(")
if e - a <= k:
    print(ans1)
else:
    print(ans2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if l[4]-l[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 (e-a)>k:
	print(":(")
	
else:
	print("Yay!")

Submission status: Accepted

Solution code:
list = []
for n in range(5):
  list.append(int(input()))
list.sort()

if abs(list[0]-list[-1]) > int(input()):
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

if a[4]-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 b-a<=k and c-b<=k and d-c<=k and e-d<=k and c-a<=k and d-a<=k and e-a<=k and d-b<=k and e-b<=k and e-c<=k:
    print('Yay! ')
else:
    print(':(')

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a = [int(input().rstrip('\n')) for _ in range(5)]
    k = int(input().rstrip('\n'))
    a.sort()
    print("Yay!" if abs(a[0] - a[-1]) <= k else ":(")


if __name__ == '__main__':
    slove()

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

Submission status: Accepted

Solution code:
n = []

for i in range(0,5) :
    n.append(int(input()))

k = int(input())

count = 0

for p in range(0, 4) :
    for q in range(p + 1, 5) :
        if n[q] - n[p] > k :
            print(':(')
            exit()

print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

gap = [abs(a-e),abs(b-e),abs(c-e),abs(d-e)]

for i in range(len(gap)):
	if gap[i] > k:
		print(':(')
		sys.exit()
print('Yay!')

Submission status: Accepted

Solution code:
import sys

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

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

gap = [abs(a-e),abs(b-e),abs(c-e),abs(d-e)]

for i in range(len(gap)):
	if gap[i] > k:
		print(':(')
		sys.exit()
print('Yay!')

Submission status: Accepted

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

if max(antenna)-min(antenna) > k:
    print(":(")
else:
    for i in range(len(antenna)):
        for j in range(len(antenna)):
            if abs(antenna[i]-antenna[j]) > k:
                ans = ":("
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations
antena = [int(input()) for _ in range(5)]
k = int(input())
ans = True
for cmb in combinations(antena, 2):
    ans &= abs(cmb[0]-cmb[1])<=k
if ans:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

a=INPUT[0]
e=INPUT[4]
k=INPUT[5]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    import itertools
    input = sys.stdin.readline
    ae = [int(input().rstrip('\n')) for _ in range(5)]
    k = int(input().rstrip('\n'))
    for v in itertools.combinations(ae, 2):
        i, j = v
        if abs(i - j) > k:
            print(":(")
            exit()
    print("Yay!")


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''A - Five Antennas
https://atcoder.jp/contests/abc123/tasks/abc123_a

>>> main([1, 2, 4, 8, 9], 15)
Yay!
>>> main([15, 18, 26, 35, 36], 18)
:(

in1.txt
>>> main([0, 7, 9, 52, 123], 123)
Yay!'''

from itertools import permutations


def main(_input, k):
    for p in permutations(_input, 2):
        if p[0] - p[1] > k:
            print(':(')
            return

    print('Yay!')


if __name__ == "__main__":
    _input = []

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

    k = int(input())

    main(_input, k)

Submission status: Accepted

Solution code:
l =[]
for i in range(6):
  a =int(input())
  l.append(a)
if l[-2] - l[0] > l[-1]:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
import sys
lst=[0]*6
for i in range(6):
  lst[i]=int(input())
k=lst[-1]
for i in range(4):
  for j in range(i+1,5):
    if abs(lst[i]-lst[j])>k:
      print(':(')
      sys.exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2019/10/03
# a, b, c, d, e, k = list(map(int, open(0).read().split()))
# print("Yay!" if (b-a<=k and c-a<=k and d-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) else ":(") )

antn = list(map(int, open(0).read().split()))
flg = 0
for i in range(0,4):
#    print(i,j)
    j=0
    for j in range(i+1, 5):
        if (antn[j] - antn[i] > antn[5]):
            flg = 1
print("Yay!" if flg == 0 else ":(")

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
for x in [a, b, c, d, e]:
    for y in [a, b, c, d, e]:
        if x != y:
            if k < abs(x - y):
                print(":(")
                exit()
print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = [int(input()) for i in range(6)]
diff = s[4]-s[0]
k = s[5]

if diff > k:
  print(':(')
elif diff <= k:
  print('Yay!')

Submission status: Accepted

Solution code:
ant = [int(input()) for _ in range(6)]
ans = "Yay!"
for i in range(len(ant) - 1):
    for j in range(i + 1, len(ant)):
        if abs(ant[i] - ant[j]) > ant[-1]:
            ans = ":("
            break
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 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())
if e - a <= k:
         print("Yay!")
else:
         print(":(")

Submission status: Accepted

Solution code:
from itertools import combinations
inputs = [int(input()), int(input()), int(input()), int(input()), int(input())]
K=int(input())
print('Yay!' if all([1 if abs(cmb[0]-cmb[1]) <= K else 0 for cmb in combinations(inputs,2)]) else ':(')

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
l = [e, d, c, b, a]
for i in range(len(l)-1):
  for j in range(len(l)):
    if l[i]-l[j] > k:
      print(":(")
      quit()
print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
coordinates = [a, b, c, d, e]
for i in range(5):
    for j in range(i + 1, 5):
        if coordinates[j] - coordinates[i] > 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 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:
s=[int(input()) for i in range(5)]
k=int(input())
print("Yay!" if abs(max(s)-min(s))<=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())
S=[a,b,c,d,e]
print("Yay!" if abs(max(S)-min(S)<=k) else ":(")