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 i in range(5)]
k = int (input())
max_dis = max([abs(A[i] - A[j]) for i in range(5) for j in range(i+1, 5)])
print(":(") if max_dis > k else print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,*_,e,k=map(int,open(0).read().split());print("Y:a(y !"[e-a>k::2])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

length = e - a

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

Submission status: Accepted

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

Submission status: Accepted

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

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

j = True

for i in range(len(lis)):
  for m in range(len(lis)):
    if abs(lis[i] - lis[m]) > k:
      j = False
    else:
      pass
    
if j:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
s=[int(input()) for i in range(6)]
a=0
b=0
for j in range(5):
  for k in range(5):
    if j==k:
      continue
    else:
      if abs(s[j]-s[k])>s[5]:
        a+=1
if 0==a:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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

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

print('Yay!')

Submission status: Accepted

Solution code:
x = [int(input()) for i in range(5)]
k = int(input())
flag = 0
for i in range(5):
  for j in range(4):
    if x[i] - x[j] > k:
      flag = 1
else:
  if flag == 1:
    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:
  print(':(')
  exit()
elif c-a > k:
  print(':(')
  exit()
elif d-a > k:
  print(':(')
  exit()
elif e-a > k:
  print(':(')
  exit()
else:
  print('Yay!')

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """1
2
4
8
9
15"""
        output = """Yay!"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """15
18
26
35
36
18"""
        output = """:("""
        self.assertIO(input, output)

def resolve():
    a=[int(input()) for i in range(5)]
    k=int(input())
    for i in range(4):
        for j in range(i+1,5):
            if a[j]-a[i]>k:
                print(':(')
                return()
    else:
        print('Yay!')


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

distance = []
for i in range(4):
    for j in range(i + 1, 5):
        distance.append(anntena[j] - anntena[i])
    
tmp = [i for i in distance if i  > k ]
if len(tmp) == 0:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
import itertools

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

combs = itertools.combinations(plots, 2)
for comb in combs:
    if abs(comb[0]-comb[1]) > k:
        print(":(")
        exit()

print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = 5
lst = []
for e in range(N):
    lst.append(int(input()))
k = int(input())
flag = True
for i,a in enumerate(lst):
    if not flag:
        break
    l = lst[i:]
    for b in l:
        if abs(a-b) > k:
            flag = False
            break
if flag:
    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(":(")
else:
  print("Yay!")

Submission status: Accepted

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

for i in range(4):
    for j in range(i+1,5):
        if abs(a[i]-a[j]) > a[5]:
            flag = False
            break
if flag == True:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(5)]
k = int(input())
for i in range(len(a)):
  for j in range(i+1,len(a)):
    if abs(a[i]-a[j])>k:
      print(":(")
      quit()
print("Yay!")

Submission status: Accepted

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

flag = True
for i in range(4):
    for j in range(i+1, 5):
        if abs(a[i] - a[j]) > a[5]:
            flag = False
            break

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

Submission status: Accepted

Solution code:
a,b,c,d,e,k = map(int,open(0).read().split())
if e-a <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
a, b, c, d, e, k = [int(input()) for _ in range(6)]
# print(a, k)
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:
first_num = int(input())
 
for i in range(3):
  passed_num = int(input())

end_num = int(input())
  
k = int(input())  
print('Yay!' if end_num - first_num <= 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())

p = [a, b, c, d, e]
count = 0
for i in range(5):
    for j in range(i, 5):
        if p[j] - p[i] > k:
            count += 1
            break
if count > 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 e-a > k:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
antennas = [0]* 5
for i in range(5):
    antennas[i] = int(input())
k = int(input())
connectable = True
for i in range(5):
    for j in range(i+1, 5):
        if (antennas[j] - antennas[i]) > k:
            connectable = False
if connectable:
    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())
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:
#18:10
l = []
for _ in range(5):
  l.append(int(input()))
k = int(input())
if l[-1] - l[0] > k:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

out = 0
for i in range(5):
    for j in range(i+1,5):
        if ABCDE[j] - ABCDE[i] > K:
            out += 1
            break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(input())for i in range(5)]
k = int(input())
cnt = 0
for i in a:
    for j in a:
        if abs(i-j) > k:
            print(':(')
            cnt += 1
            break
    else:
        continue
    break
if cnt == 0:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
fl = 0
for i in range(5):
    for j in range(i,5):
        if a[j] - a[i] > k:
            fl = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations

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

res = True
for a, b in combinations(xs, 2):
    if abs(a - b) > k:
        res = False
        break
print("Yay!" if res else ":(")

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
*a,k=map(int,open(0))
print("Y:a(y !"[a[4]-a[0]>k::2])

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:
L = [int(input()) for i in range(6)]
#print(L)
d = L[4] - L[0]

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

Submission status: Accepted

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

r = "Yay!"
for i in range(5):
	if (r == ":("):
		break
	for n in range(i+1, 5):
		if((s[n] - s[i]) > k):
			r = ":("
			break

print (r)

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

Submission status: Accepted

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

for i in range (0,5):
  for j in range(i+1,5):
#    print(i,j)
    if abs(a[i]-a[j]) >k:
      print(":(")
      exit()
print("Yay!")

Submission status: Accepted

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

k=int(input())

mi = min(a)
ma = max(a)

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

Submission status: Accepted

Solution code:
x=[int(input()) for _ in range(5)]
x.reverse()
k=int(input())
for i in range(5):
    for j in range(i+1,5):
        if x[i]-x[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 e - a <= k:
    print('Yay!')

if e - a > k:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#123a
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
s=[a,b,c,d,e]
if max(s)-min(s)<=k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

k = int(input())


n = [i - j for i in l for j in l]

if max(n) > 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())
A = [a,b,c,d,e]
ind = 0
for i in range(4):
    for j in range(i+1,5):
        if A[j]-A[i]>k:
            ind = 1
            break
    if ind==1:break
if ind==1:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
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("Yay!" if a[4] - 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, b, c, d, e, k = [int(input()) for _  in range(6)]

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

Submission status: Accepted

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

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:
n = [int(input()) for i in range(6)]
if max(n[0], n[1], n[2], n[3], n[4]) - min(n[0], n[1], n[2], n[3], n[4]) <= n[5]:
  print("Yay!")  
else:
  print(":(")

Submission status: Accepted

Solution code:
A=[0]*5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
K = int(input())
 
for i in range(4):
  for j in range(i+1,5):
    if abs(A[i]-A[j]) > K:
      print(':(')
      exit()
print('Yay!')

Submission status: Accepted

Solution code:
ans = "Yay!"
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:
    ans = ":("
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

N = 5
A = np.array([int(input()) for i in range(N)])
k = int(input())

xx, yy = np.meshgrid(A, A)
comb = np.c_[xx.flatten(), yy.flatten()]

diff_ = np.abs(comb[:, 0] - comb[:, 1])
max_diff = np.max(diff_)

if max_diff <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    X = [int(input()) for _ in range(5)]
    K = int(input())
    flag = True
    for j in range(1, 5):
        for i in range(0, j):
            if max(X[j] - X[i], X[i] - X[j]) > K:
                flag = False
    if flag:
        print('Yay!')
    else:
        print(':(')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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 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:
li1 = [int(input()) for i in range(6)]

aim = li1[5]
li1.pop(-1)
maxv = max(li1)
minv = min(li1)
aveg = maxv -minv

if aveg<= aim:
    print("Yay!")    
else:
    print(":(")

Submission status: Accepted

Solution code:
N=5
l=[]
for i in range(5):
  l.append(int(input()))
k=int(input())
ans="Yay!"
for i in range(5):
  for j in range(i+1,5):
    if abs(l[i]-l[j]) > 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 = [int(input()) for i in range(6) ]
print(":(" if l[4] - l[0] > l[5] else "Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=[int(input()) for _ in range(6)];print(":(" if l[4]-l[0]>l[5] 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())

if max(a,b,c,d,e)-min(a,b,c,d,e) > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

if nums[-1] - nums[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-d > k or e-c > k or e-b > k or e-a > k or d-c > k or d-b > k or d-a > k or c-b > k or c-a > k or 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())

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

Submission status: Accepted

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

ans = 'Yay!'
for i in range(1, 5):
    if A[i] - A[0] > k:
        ans = ':('
        break

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, k = sorted(list(int(input()) for _ in range(5))),int(input())
print(":(" if a[4] - a[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())
if e-a > k:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
from itertools import combinations
a, b, c, d, e, k = map(int, [input() for _ in range(6)])
for c in combinations([a, b, c, d, e], 2):
  l = list(c)
  if abs(l[0] - l[1]) > k:
    print(":(")
    exit(0)
print("Yay!")

Submission status: Accepted

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

# solution
if max(a) - min(a) > k: res = ':('
else: res = 'Yay!'

# output
print(res)

Submission status: Accepted

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

aaaaa=0
list=[a,b,c,d,e]
for i in range(4):
    for j in range(i+1,5):
        if abs(list[i]-list[j])>k:
            aaaaa=1
if aaaaa==1:
    print(":(")
else:
    print('Yay!')

Submission status: Accepted

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

for i in range(4):
    for j in range(i+1, 5):
        if abs(n[i]-n[j]) <= n[len(n)-1]:
            continue
        else:
            print(':(')
            sys.exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Ant = [int(input()) for i in range(5)]
k = int(input())
ans = "Yay!"
for i in range(5):
    for j in range(i+1,5):
        if Ant[j]-Ant[i] > k:
            ans =":("
print(ans)

Submission status: Accepted

Solution code:
a = [None] * 5
for i in range(5):
  a[i] = int(input())
k = int(input())
ans = 'Yay!'

for i in range(4):
  if a[i] + k < max(a):
    ans = ':('
    break
print(ans)

Submission status: Accepted

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

ans = 'Yay!'
for i in range(5):
  for j in range(i+1,5):
    if p[j]-p[i] > 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())

list = [a,b,c,d,e]
for i in range(0,len(list)-1):
    for j in range(i+1,len(list)):
        if list[j] - list[i] > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())
    A = [a,b,c,d,e]
    for i in range(len(A)):
        for j in range(i,len(A)):
            if A[j] - A[i] > k:
                print(':(')
                exit()

    print('Yay!')

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(3):
    for j in range(i+1,5):
        if abs(p[i]-p[j])>k:
            flag=False
            print(":(")
            exit(0)

print("Yay!")

Submission status: Accepted

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

for i in range(5):
  for j in range(i+1, 5):
    if c[j] - c[i] > k:
      print(':(')
      exit()
print('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:
antenas = []
distance = 0
for i in range(6):
    if i <= 4:
        antenas.append(int(input()))
    else:
        distance = int(input())
cand = []
for i in range(len(antenas)):
    for j in range(i, len(antenas)):
        cand.append(antenas[j] - antenas[i])
flag = True
for i in range(len(cand)):
    if cand[i] > distance:
        print(':(')
        flag = False
        break
if flag:
    print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
list = list(int(input()) for i in range(6))

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

Submission status: Accepted

Solution code:
data = []
for i in range(5):
    data.append(int(input()))
k = int(input())
data.sort()
if data[4] - data[0] > k:
    print(":(")
else:
    print("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:
a = [int(input()) for _ in range(5)]
k = int(input())
print("Yay!") if max(a)-min(a)<=k else print(":(")

Submission status: Accepted

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

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

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:
I = [int(input()) for _ in range(6)]

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

Submission status: Accepted

Solution code:
a=int(input())
b=input()
c=input()
d=input()
e=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[4] - A[0] <= K else ':(')

Submission status: Accepted

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

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

k=int(input())

i=0
while i<4:
  j=i+1
  while j<5:
    if abs(r[i]-r[j])>k:
      print(":(")
      exit()
    
    j+=1
  i+=1
  
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:
p = [int(input()) for _ in range(5)]
k = int(input())
ans = "Yay!"

for i in range(4):
    for j in range(i + 1, 5):
        if p[j] - p[i] > k:
            ans = ":("

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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