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:
def solve(start, end, limit):
    # time O(1)
    return ":(" if end - start > limit else "Yay!"


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

    ans = solve(a, e, k)
    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k=int(input())
f=1

for i in range(len(li)):
    for j in range(i+1, len(li)):
        if abs(li[i]-li[j])>k:
            f=0

if f:
    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 - Five Antennas
# https://atcoder.jp/contests/abc123/tasks/abc123_a
NUM_ANTENNAS = 5
antennas = list()
for _ in range(NUM_ANTENNAS):
    antennas.append(int(raw_input()))
k = int(raw_input())
print 'Yay!' if (antennas[-1]-antennas[0]) <= k else ':('

Submission status: Accepted

Solution code:
antenna = []
bool = True

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

antenna.sort()
if abs(antenna[0] - antenna[-1]) > max_distance:
    bool = False
    
if bool:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
antenna = []
bool = True

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

for i in range(5):
    for j in range(5):
        if abs(antenna[i] - antenna[j]) > max_distance:
            bool = False
            
if bool:
    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 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())

ans = True
x = [a,b,c,d,e]
dist = max(x) - min(x)
if dist > k:
    ans = False

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

Submission status: Accepted

Solution code:
list = []
for i in range(5):
  list.append(int(input()))
list = list[::-1]
k = int(input())
dist = 0
j = 0
cant_connect = False
for i in range(5):
  for j in range(i+1, 5):
    dist = list[i] - list[j]
    if dist > k:
      cant_connect = True
      break
  if cant_connect:
    break
if cant_connect:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
a=[]

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

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

Submission status: Accepted

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

if nums[4] - nums[0] > nums[5]:
  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())

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

Submission status: Accepted

Solution code:
# TODO A - Five Antennas
# https://atcoder.jp/contests/abc123/tasks/abc123_a
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
print 'Yay!' if (e-a) <= k else ':('

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def Antennas(a,b,c,d,e,k):
    if (b-a)>k or (c-a)>k or (d-a)>k or (e-a)>k:
        return ':('
    else:
        return 'Yay!'

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

Submission status: Accepted

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

List = [a,b,c,d,e]
if max(List) - min(List) <= k:
	print("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())
f = b-a
g = c-a
h = d-a
i = e-a
j = c-b
l = d-b
m = e-b
n = d-c
o = e-c
p = e-d
if f<=k and g<=k and h<=k and i<=k and j<=k and l<=k and m<=k and n<=k and o<=k and p<=k:
    print("Yay!")
else:
    print(":(")

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())
for i,j in itertools.combinations([a,b,c,d,e], 2):
    if abs(i-j)>k:
        print(':(')
        exit()
print('Yay!')

Submission status: Accepted

Solution code:
l = []

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

Submission status: Accepted

Solution code:
list1=[int(input()) for i in range(5)]
k=int(input())
count=0
for i in range(5):
    for j in range(i):
        if list1[i]-list1[j]<=k:
            count+=1
str1=":("
if count==10:
    str1="Yay!"
print(str1)

Submission status: Accepted

Solution code:
import numpy as np
line = np.zeros([5,])
for i in range(0,5):
    line[i] = int(input())

k = int(input())
if line.max()-line.min()>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:
List = []
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
List.append(int(input()))
k = int(input())

CW = []
for i in range(len(List)):
    for j in range(i+1,len(List)):
        if List[j]-List[i] <= k:
            CW.append(True)
        else:
            CW.append(False)

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

Submission status: Accepted

Solution code:
import sys
if __name__ == "__main__":
    N=6
    in_lst=[]
    for _ in range(N):
        in_lst.append(int(input()))
    for i in in_lst[:-1]:
        for j in in_lst[:-1]:
            if j-i>in_lst[-1]:
                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('Yay!')
else:
    print(':(')

Submission status: Accepted

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

ret = "Yay!"
for i ,coordinate_i in enumerate(antenna):
    for i ,coordinate_j in enumerate(antenna):
        if k < abs(coordinate_i - coordinate_j):
            ret = ":("

print(ret)

Submission status: Accepted

Solution code:
L=[]
for i 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=(int(input()));input();input();input();b=(int(input()))
if int(input()) >= b-a:
	print("Yay!")
else:
	print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

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

k = int(input())

if pos[4] - pos[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:
arr=[]
for i in range(5):
    arr.append(int(input()))
k = int(input())

i=0
singi=0
if k >= arr[4] - arr[0]:
    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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

Solution code:
import itertools
import sys

def main():
    n = []
    for i in range(5):
        n.append(int(input()))
    k = int(input())
    for c in itertools.combinations(n, 2):
        if abs(c[0] - c[1]) > k:
            print(':(')
            sys.exit()
    else:
        print('Yay!')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
arr=[0,0,0,0,0,0]
for i in range(0,6):
	arr[i]=int(input())

if arr[4]-arr[0] > arr[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:
atoe =[int(input()),int(input()),int(input()),int(input()),int(input())]
k = int(input())

maxNum = 5
_err = 0
for i in range(0, maxNum):
    for j in range(i+1, maxNum):
        if abs(atoe[i] - atoe[j]) > k:
            _err = 1

if _err:
    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:
def main():
    if sub():
        print("Yay!")
    else:
        print(":(")


def sub() -> bool:
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    points = [a, b, c, d, e]
    k = int(input())

    for i in points:
        for j in points:
            if abs(i - j) <= k:
                continue
            else:
                return False
    return True


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

Solution code:
def antena(k,p,q):
    if((p-q) >k):
        return False
    else:
        return True

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

for i in range(5):
    for j in range(5):
        if(not antena(x[i],x[j],x[5])):
            print(":(")
            exit()

print("Yay!")

Submission status: Accepted

Solution code:
import os
import sys



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

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

Submission status: Accepted

Solution code:
a=input()
for i in range(3):
  input()
e=input()
k=input()
if int(e)-int(a)<=int(k):
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
p = -1
q = 124

for _ in range(5):
    a = int(input())
    p = max(p, a)
    q = min(q, a)
    
k = int(input())

if p - q <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
p = -1
q = 124

for _ in range(5):
  a = int(input())
  p = max(p, a)
  q = min(q, a)

k = int(input())

if p - q <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

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

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

K = int(input())

if L[4]-L[0]<=K:
    ans = 'Yay!'
else:
    ans = ':('

print(ans)

Submission status: Accepted

Solution code:
X = []
# X = [15, 18, 26, 35, 36]
# X = [1, 2, 4, 8, 9]
# k = 15

for _ in range(5):
    X.append(int(input()))  # S += [input()] とも書ける
k = int(input())

for x in range(len(X)):
    for y in range(x+1, len(X)):
        # print(x, y, k, X[y] - X[x])

        if k < X[y] - X[x]:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
n = 0
if e-a > k or e-b > k or d-a > k or e-c > k or d-b > k or c-a > k or e-d > k or d-c > k or c-b > k or b-a > k:
    n = 1

if n == 1:
    print(":(")
if n == 0:
    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(":(")
else : print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def find(array, k):
    for i in range(5):
        for j in range(5):
            if(i != j):
                if(array[i]-array[j] > k):
                    return False
    return True


result = "Yay!" if find(array, k) == True else ":("
print(result)

Submission status: Accepted

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

if antenna[4]-antenna[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())
x = int(input())

f  = True 

la = [a,b,c,d,e]
lb = [a,b,c,d,e]

for e, v in enumerate(la):
    for e2,v2 in enumerate(lb):
        if e < e2:
            if v2 - v > x:
                f = False

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

Submission status: Accepted

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

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]
ans='Yay!'

for i in list:
  for j in list:
    if j-i > k:
      ans=':('
      
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if d[4] - d[0] <= 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:
antenna = [int(input()) for _ in range(5)]
k = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

b=[]
b.append(abs(a[0]-a[1]))
b.append(abs(a[0]-a[2]))
b.append(abs(a[0]-a[3]))
b.append(abs(a[0]-a[4]))
b.append(abs(a[2]-a[3]))
b.append(abs(a[2]-a[1]))
b.append(abs(a[3]-a[1]))
b.append(abs(a[4]-a[1]))
b.append(abs(a[2]-a[4]))
b.append(abs(a[3]-a[4]))

for i in range(0,10):
    if a[5]<b[i]:
        print(':(')
        break
    else:
        if i==9:
            print('Yay!')
        else:
            continue

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

city = [e, d, c, b, a]
result = 'Yay!'
for i, c in enumerate(city):
    for u in city[i + 1:len(city)]:
        if (c - u) > k:
            result = ':('
            break;
print(result)

Submission status: Accepted

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

city = [e,d, c, b, a]
result = 'Yay!'
for i, c in enumerate(city):
    for cC in city[i + 1:len(city)]:
        if (c - cC) > k:
            result = ':('
            break;
print(result)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
list=[]
list.append(a)
list.append(b)
list.append(c)
list.append(d)
list.append(e)
if max(list)-min(list)>k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Plot = []

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

max_distance = int(input())

for i in range(9):
    if(i < 4):
        if(abs(Plot[0] - Plot[i+1]) > max_distance):
            print(":(")
            break
    elif(4 <= i <= 6):
        if (abs(Plot[1] - Plot[i-2]) > max_distance):
            print(":(")
            break
    elif(6 < i < 8):
        if (abs(Plot[2] - Plot[i - 5]) > max_distance):
            print(":(")
            break
    elif(i == 8):
        if(abs(Plot[3] - Plot[4]) > max_distance):
            print(":(")
        else:
            print("Yay!")

Submission status: Accepted

Solution code:
import sys

d = [int(i) for i in sys.stdin.read().split('\n') if i != '']
k = d[5]
d = d[:5][::-1]


def check(k, d):
    for i in range(len(d[:4])):
        for j in range(i, len(d)):
            if d[i] - d[j] > k:
                return False
    return True


if check(k, d):
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
a,b,c,d,e,k = int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
antennas = [a,b,c,d,e]
def a(antennas, k):
  if k == 0:
    print("Yay!")
    return
  for i in range(4):
    for j in range(i,5):
      if abs(antennas[i]-antennas[j]) > k:
        print(":(")
        return
  print("Yay!")
  return
a(antennas, k)

Submission status: Accepted

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

k=int(input())

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

Submission status: Accepted

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

k=int(input())

an = sorted(an)

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

Submission status: Accepted

Solution code:
a,b,c,d,e,k = map(int, [input() for i in range(6)])
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 _ in range(5)]
k = int(input())
if(a[4]-a[0]>k):
    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("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 = []
for _ in range(5):
  a.append(int(input()))
k = int(input())
if a[-1] - a[0] > 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())

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

Submission status: Accepted

Solution code:
import itertools
a = []
for _ in range(5):
  a.append(int(input()))
k = int(input())
a = a[::-1]
combs = itertools.combinations(a, 2)
for (n, m) in combs:
    if n - m > 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(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
# A - Five Antennas 

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

flag_disconnectable = False
for i in range(5):
    for j in range(5):
        if i == j: continue
        if (lis[j]-lis[i]) > k:
            flag_disconnectable = True
            break

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

Submission status: Accepted

Solution code:
import itertools
a = []
for _ in range(5):
  a.append(int(input()))
k = int(input())
combs = itertools.combinations(a, 2)
l = [(n,m) for (n, m) in combs if m - n > k]
if len(l) == 0:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())
    
    a1 = b-a
    a2 = c-a
    a3 = d-a
    a4 = e-a
    b1 = c-b
    b2 = d-b
    b3 = e-b
    c1 = d-c
    c2 = e-c
    d1 = e-d
    
    if (a1 <= k and a2 <= k and a3 <= k and a4 <= k and b1 <= k and b2 <= k and b3 <= k and c1 <= k and c2 <= k and d1 <= k):
        print("Yay!")
    else:
        print(":(")

Submission status: Accepted

Solution code:
import sys

e = [int(sys.stdin.readline().rstrip()) for _ in range(6)]
if e[-2] - e[0] > e[-1]:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

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

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

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)

l=e-a

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

a = []
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
k = int(input())

ok = True
for i, j in itertools.product(a, a):
    if (j - i) < 0:
        continue
    if k >= (j - i):
        pass
    else:
        ok = False
        break

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

Submission status: Accepted

Solution code:
dists = [int(raw_input()) for i in range(6)]
print "Yay!" if dists[4] - dists[0] <= dists[5] 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:
ar = []
for i in range(5):
    l = int(input())
    ar.append(l)
r = int(input())
for i in range(1,5):
    if ar[i] - ar[0] > r:
        print(":(")
        exit()
print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A=list(int(input())for i in range(5))
k=int(input())
dis=max(A)-min(A)
if dis<=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())

a_e = e-a

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

ans = "Yay!"

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

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

Submission status: Accepted

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

ans = max(a) -min(a)
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())

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

for i in range(5):
 f=R[i]-R[0]
 g=R[i]-R[1]
 h=R[i]-R[2]
 j=R[i]-R[3]
 if f>k or g>k or h>k or j>k:
  print(":(")
  exit()
print("Yay!")

Submission status: Accepted

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

if max(data[:-1]) - min(data[:-1]) <= data[-1]:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
t = "Yay!"
f = ":("

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

if max(antennas) <= k:
    print(t)
else:
    flag = True
    for i in antennas:
        for j in antennas:
            if abs(i - j) >= k:
                flag = False
    if flag:
        print(t)
    else:
        print(f)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a=int(input())
m=n=a
ans="Yay!"
for i in range(4):
    t=int(input())
    if(m<t):
        m=t
    elif(n<t):
        n=t
k=int(input())
if(m-n>k):
    ans=":("
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a = []
for i in range(6):
    a.append(int(input()))
for i in range(5):
    for j in range(5):
        if abs(a[i] - a[j]) > a[5]:
            print(':(')
            sys.exit()
print('Yay!')

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = [int(input()) for i in range(6)]
k = n[5]
ret = "Yay!"
for i in range(5):
    x = n[i]
    for j in range(1,5-i):
        y = n[i+j]
        if(y-x>k):
            ret = ":("
            break
    else:
        continue
    break

print(ret)