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

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

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

Solution (Python):
a = []

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

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

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

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

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

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

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

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

Solution (Python):
l = list(map(int, [input() for i in range(5)]))
k = int(input())

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

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

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

Solution (Python):
import itertools

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):

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

""" 提出版
if b - a <= k:
    if c - a <= k:
        if d - a <= k:
            if e - a <= k:
                if c - b <= k:
                    if d - b <= k:
                        if e - b <= k:
                            if d - c <= k:
                                if e - c <= k:
                                    if e - d <= k:
                                        print("Yay!")
                                    else:
                                        print(":(")
                                else:
                                    print(":(")
                            else:
                                print(":(")
                        else:
                            print(":(")
                    else:
                        print(":(")
                else:
                    print(":(")
            else:
                print(":(")
        else:
            print(":(")
    else:
        print(":(")
else:
    print(":(")
"""

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

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

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

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

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

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

Solution (Python):
import sys

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

i=0
j=0

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

for i in range(arg1,loops1):
	for j in range(arg2,loops2):
		if (args[j] - args[i]) > args[5]:
			print(":(")
			sys.exit()
print("Yay!")

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

Solution (Python):

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!")

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

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

Solution (Python):
pos = [int(input()) for _ in range(5)]
k = int(input())
res=True
for i in range(4):
    if pos[i+1]-pos[i]>k:
        res=False
if pos[-1] - pos[0]<=k:
    print('Yay!')
else:
    print(':(')

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

for i in range(0, 4):
    for j in range(i+1, 5):
        if int(antena[j])-int(antena[i])> int(antena[5]):
            print(":(")
            exit()
        else:
            flag = False
            continue

print("Yay!")

Solution (Python):
li = []
for i in range(5):
  li.append(int(input()))
k = int(input())
fl = True
for i in range(5):
  for j in range(i+1,5):
    if abs(li[i]-li[j]) > k:
      fl = False
if fl == True:
  print("Yay!")
else:
  print(":(")

Solution (Python):
a = [int(input()) for i in range(5)]
k = int(input())
flag = True
for i in range(5):
    for j in range(i + 1, 5):
        flag &= a[j] - a[i] <= k
print("Yay!" if flag else ":(")

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

message = 'Yay!'
for i in range(5):
    for l in location[i:]:
        if (l - location[i]) > k:
            message = ':('

print(message)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
array=[a,b,c,d,e]
flag=True
 
for i in range(5):
  for j in range(5):
    if array[i]-array[j] > k:
      flag=False
      print(":(")
      break
  if not flag:
    break
      
if flag:
  print("Yay!")

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

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

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

Solution (Python):
n = 6;
a = [input() for i in range(n)];
 
k = a[-1];
ans = "Yay!";
 
for i in range(n-1):
  for j in reversed(range(n-1)):
    if k < a[i] - a[j]:
      ans = ":( ";
      break;
print ans;

Solution (Python):
import sys

point = []

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

k = int(input())


for i in range(0, len(point)):
  for j in range(i + 1, len(point)):
    if abs(point[i] - point[j]) > k:
      print(":(")
      sys.exit()



print("Yay!")

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

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

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

Solution (Python):
from itertools import combinations
a = [int(input()) for _ in range(5)]
k = int(input())
for b in combinations(a, 2):
    if abs(b[0]-b[1]) > k:
        exit(print(':('))
print('Yay!')

Solution (Python):
a=int(input())
b=int(input())
v=int(input())
d=int(input())
e=int(input())
k=int(input())

if b-a>k:
  print(':(')
elif v-a>k:
  print(':(')
elif d-a>k:
  print(':(')
elif e-a>k:
  print(':(')
elif v-b>k:
  print(':(')
elif d-b>k:
  print(':(')
elif e-b>k:
  print(':(')
elif d-v>k:
  print(':(')
elif e-v>k:
  print(':(')
elif e-d>k:
  print(':(')
else:
  print('Yay!')

Solution (Python):
a = []

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

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
 
max_diff = max([a, b, c, d, e]) - min([a, b, c, d, e])
ans = "Yay!"
if(max_diff > k):
    ans = ":("
print(ans)

Solution (Python):
max_num = 0
a = int(input())
for i in range(3):
    input()
e = int(input())
k = int(input())
if k < e - a:
    print(':(')
else :
    print('Yay!')

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
K = int(input())

L = [A,B,C,D,E]

for i in range(len(L)):
    for j in range(i+1,len(L)):
        if(abs(L[i]-L[j])>K):
            print(":(")
            exit()


print("Yay!")

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B, C, D, E, K):
    a = A, B, C, D, E
    for p, q in combinations(a, r=2):
        if abs(p-q) > K:
            return ':('


    return 'Yay!'


def main():
    A = read_int()
    B = read_int()
    C = read_int()
    D = read_int()
    E = read_int()
    K = read_int()

    print(slv(A, B, C, D, E, K))


if __name__ == '__main__':
    main()

Solution (Python):
t = [0] * 5
t[0] = int(input())
t[1] = int(input())
t[2] = int(input())
t[3] = int(input())
t[4] = int(input())
k = int(input())

def check():
    if t[4] - t[0] > k:
        return ':('
    return 'Yay!'

print(check())

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

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

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

Solution (Python):
list = [int(input()) for i in range(6)]

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

Solution (Python):
def main ():
    antennas= []
    max     = 0
    for i in range(6):
        if i < 5:
            antennas.append(int(input()))
        else:
            max = int(input())
    print (distance_comparison(max,antennas))

def distance_comparison(max,antennas):
    memo = []
    for i in range(len(antennas)):
        compnum = i+1
        for j in range(len(antennas[compnum:])):
            append_data = abs(antennas[i] - antennas[compnum])
            if append_data <= max:
                memo.append(append_data)
            else:
                return ":("
            compnum+=1
    return "Yay!"


main()

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

Solution (Python):


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

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


ans = 'Yay!'
for i in range(0, len(antenna)-1):
    current = antenna[i]
    for n in range(i+1, len(antenna)):
        if abs(current - antenna[n]) > k:
            ans = ':('
            break

print(ans)

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

r = 0
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!")

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

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

Solution (Python):



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

Solution (Python):

import numpy as np
A = np.zeros(6)
for i in range(6):
    A[i] = int(input())
if A[4] - A[0] <= A[5]:
    print("Yay!")
else:
    print(":(")

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

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

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

l = [a, b, c, d, e]
d = list()

for i, x in enumerate(l[:-1]):
    l2 = l[i+1:]
    for y in l2:
        d.append(y-x)

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

Solution (Python):
li = []
for l in range(6):
    li.append(input())

t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) > int(s):
            t = 1
        elif int(i) - int(k) > int(s):
            t = 1

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

Solution (Python):
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
h=c-b
i=d-b
j=e-b
k=f-b
l=d-c
m=e-c
n=f-c
o=e-d
p=f-d
q=f-e
r=int(input())
s=":("
if r<h:
  print(s)
elif r<i:
  print(s)
elif r<j:
  print(s)
elif r<k:
  print(s)
elif r<l:
  print(s)
elif r<m:
  print(s)
elif r<n:
  print(s)
elif r<o:
  print(s)
elif r<p:
  print(s)
elif r<q:
  print(s)
else:
  print("Yay!")

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

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
K = int(input())

def main():
    if E - A > K:
        print(":(")
    else:
        print("Yay!")


if __name__ == '__main__':
    main()

Solution (Python):
A=[0]*6
for i in range(6):
    A[i]=int(input())
count=0
for i in range(5):
    for j in range(i+1,5):
        if A[j]-A[i]>A[5]:
            print(":(")
            exit()
print("Yay!")

Solution (Python):




def solveProblem(a,b,c,d,e,k):
	if k < b - a :return ":("
	if k < c - a :return ":("
	if k < d - a :return ":("
	if k < e - a :return ":("
	if k < c - b :return ":("
	if k < d - b :return ":("
	if k < e - b :return ":("
	if k < d - c :return ":("
	if k < e - c :return ":("
	if k < e - d :return ":("
	return "Yay!"


if __name__ == '__main__':
	a = int(input().strip())
	b = int(input().strip())
	c = int(input().strip())
	d = int(input().strip())
	e = int(input().strip())
	k = int(input().strip())
	solution = solveProblem(a,b,c,d,e,k)
	print("{}".format(solution))

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
K = int(input())

L = [A,B,C,D,E]

for i in range(len(L)):
    for j in range(i+1,len(L)):
        if(abs(L[i]-L[j])>K):
            print(":(")
            exit()


print("Yay!")

Solution (Python):
def solve():
    li = [int(input()) for _ in range(5)]
    k = int(input())
    return ":(" if li[4] - li[0] > k else "Yay!"
print(solve())

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
 
number1 = [a, b, c, d, e]
number2 = [b, c, d, e]
count = 0
 
for num1 in number1:
  for num2 in number2:
    if abs(num1 - num2) <= k:
      count += 1
if count == 20:
  print('Yay!')
else:
  print(':(')

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

Solution (Python):
lis = [int(input()) for _ in range(5)]
k = int(input())
l = sorted(lis)[0], sorted(lis)[-1]
print([':(', 'Yay!'][(l[1] - l[0]) <= k])

Solution (Python):
l = list()
for i in range(5):
    l.append(int(input()))

a=int(input())
count=0

for i in range(5):
    for j in range(5):
        if l[i]-l[j]>a:
            count+=1
if count>0:
    print(":(")
else:
    print("Yay!")

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
x = 0
y = 0

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



for i in range(5):

    for j in range(i+1, 5):
        result = antena[j] - antena[i]
        

        if result > k:
            x += 1


        else:
            y += 1
            


if x >= 1 and y < 10:
    print(":(")

elif x == 0 and y == 10:
    print("Yay!")

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

ab = b-a
ac = c-a
ad = d-a
ae = e-a
bc = c-b
bd = d-b
be = e-b
cd = d-c
ce = e-c
de = e-d

if ab <= k and ac <= k and ad <= k and ae <= k and bc <= k and bd <= k and be <= k and cd <= k and ce <= k and de <= k:
    print("Yay!")
else:
    print(":(")

Solution (Python):
array = []
output = "Yay!"
for i in range(5):
  n = int(input())
  array.append(n)

k = int(input())

for i in range(5):
  for j in range(i+1,5):
    if abs(array[i]-array[j]) > k:
      output = ":("
          
print(output)

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

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

if flag > 0:
    print(":(")
else:
    print("Yay!")

Solution (Python):

x = []

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

k = int(input())

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

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

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


i = e-a

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

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

items = [int(a), int(b), int(c), int(d), int(e)]
flg = False
for i in range(len(items)):
    for j in range(i, len(items)):
        if items[j] - items[i] > k:
            flg = True
        if flg:
            break
    if flg:
        break
if flg:
    print(':(')
else:
    print('Yay!')

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

for x in range(4):
  for y in range(4):
    s = 0
    s = int(l[x]) - int(l[y+1])
    if(s<0):
      s = -s
    if(k < s):
      print(":(")
      break
    if(x==3 & y==3):
      print("Yay!")
  else:
    continue
  break

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

Solution (Python):

"""
Created on Sat Apr  6 21:07:41 2019

@author: qqwx2_000
"""
import itertools

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

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

distance = []

for i in itertools.combinations(coordinate, r=2):
    com = i
    d = com[1] - com[0]
    distance.append(d)
k_up = [i for i in distance if k < i]

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

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

bar = inputs[:-1]
n = 5
k = inputs[-1]

ok = True

for i in range(n):
    for j in range(n):
        
        if abs(bar[i] - bar[j]) > k:
            ok = False
            break
            

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

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

Solution (Python):
k=[]
for i in range(5):
    k.append(int(input()))
kk=int(input())
if(max(k)-min(k)<=kk):
    print('Yay!')
else:
    print(r':(')

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


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

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

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

Solution (Python):
def solve():
    crd_antenna=[0]*5
    for i in range(5):
        crd_antenna[i]=int(input())
    dist_limit = int(input())
    bool = "True"
    for i in range(0,5):
        if bool == "False":
            break
        for j in range(i+1,5):
            if crd_antenna[j]-crd_antenna[i] > dist_limit:
                bool = "False"
                print(":(")
                break
            else:
                bool = "True"
    if bool == "True":
        print("Yay!")

solve()

Solution (Python):
l = []
for i in range(5):
    l.append(int(input()))
l.sort()
k = int(input())
ans = l[-1]-l[0]-k
if ans>0:
    print(':(')
else:
    print('Yay!')

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

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

Solution (Python):
ls = []
for i in range(5):
  ls.append(int(input()))
k = int(input())
a = []
for i in range(5):
  for j in range(i+1, 5):
    a.append(abs(ls[i] - ls[j]) <= k)
if all(a):
  print('Yay!')
else:
  print(':(')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
de = e - d
ce = e - c
cd = d - c
be = e - b
bd = d - b
bc = c - b
ae = e - a
ad = d - a
ac = c - a
ab = b - a
distance = [ab, ac, ad, ae, bc, bd, be, cd, ce, de]
output = []
ok = 'Yay!'
bad = ':('
for i in distance:
    if i > k:
        output.append(bad)
    elif i <= k:
        output.append(ok)
if bad in output:
    print(bad)
elif ok in output:
    print(ok)

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

for i in range(5):
    for j in range(i+1,5):
        if i==j:continue
        if antlist[j] - antlist[i] > k:
            print(":(")
            exit()

print("Yay!")

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

for i in array:
  for j in array:
    if abs(i-j) > k:
      print(":(")
      exit()
print("Yay!")

Solution (Python):

"""
Created on Sat Apr  6 21:35:04 2019

@author: yuta
"""

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

def main(x,k):
    if max(x) - min(x) <= k:
        print("Yay!")
    else:
        print(":(")
main(ABCDE,K)

Solution (Python):
a = 0
b = 0
n = 0
k = 0
c = 0
list = []
i = str(input())+" "
for n in range(4):
 i += str(input())+" "
k = int(input())
list = i.split()
for n in range(0,4):
 a = int(list[n])
 b = int(list[n+1])
 if b - a <= k:
  c += 1
a = int(list[0])
b = int(list[4])
if b - a > k:
 c = 0
if c == 4:
 print("Yay!")
else:
 print(":(")

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [tuple(map(int, l.split())) for l in sys.stdin]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a = sorted([I() for _ in range(5)])
    k = I()
    if a[-1] - a[0] > k:
        return ':('

    return 'Yay!'

print(main())

Solution (Python):


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

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

count = 0
num = len(list) - 1
for ii in range(num):
    for hh in range(num - (int(ii) - 1)):
        if list[num - ii] - list[ii] > k:
            count += 1

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

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [a,b,c,d,e]
max = max(l)
min = min(l)
if max - min <= k:
    print('Yay!')
else:
    print(':(')

Solution (Python):
n = 5
t = [int(input()) for i in range(n)]
k = int(input())


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

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

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

Solution (Python):
box=[]
for i in range(6):
  box.append(int(input()))
flag=0
if box[4]-box[0]>box[5]:
    print(':(')
else:
    print('Yay!')

Solution (Python):
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
result = 0
for i in range(len(data)):
    if data[i][0] < data[i][1]:
        if data[i][1] - data[i][0] <= k:
            result +=1
    else:
        if data[i][0] - data[i][1] <= k:
            result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

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


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

yay_flg = 0
exist_flg = 0

for x in lis:
  for j in lis2:
    if x == j:
      break
      
    if x - j <= k:
      yay_flg = 1
      
    if x - j > k:
      exist_flg = 1
      
if yay_flg == 1 and exist_flg == 0:
  print("Yay!")
  
else:
  print(":(")

Solution (Python):
x = []
for i in range(5):
        x.append(int(input()))
k = int(input())
a = x[0]
n = True
for i in x:
        b = abs(a-i)
        if b > k:
                n = False
        else:
                None
if not n:
        print(":(")
else:
        print("Yay!")

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

Solution (Python):
a,*_,e,k=(int(input())for _ in[0]*6)
print(':('if k<e-a else'Yay!')

Solution (Python):
x = []
for i in range(5):
        x.append(int(input()))
k = int(input())
a = x[0]
n = True
for i in x:
        b = abs(a-i)
        if b > k:
                n = False
        else:
                None
if not n:
        print(":(")
else:
        print("Yay!")

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

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

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

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