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

for i in range(5):
    for j in range(i):
        if Antennas[i]-Antennas[j] > k:
            print(':(')
            exit()
print('Yay!')

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

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

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

if __name__ == '__main__':
    solve()

Solution (Python):
li=[]
for i in range(5):
  li.append(int(input()))
k=int(input())
ans="Yay!"
for i in range(5):
  for j in range(5-i):
    if li[j]-li[i]>k:
      ans=":("
      break
print(ans)

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

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

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

Solution (Python):
A=[int(input()) for z in range(6)]
if 2*(2*A[4]+A[3]-A[1]-2*A[0])<5*A[5]:
    print('Yay!')
else:
    print(':(')

Solution (Python):
A=[int(input()) for i in range(5)]
k=int(input())
for i in range(5):
    for j in range(i,5):
        if abs(A[i]-A[j])>k:
            print(":(")
            exit()
print("Yay!")

Solution (Python):
import sys

*A, k = (int(input()) for _ in range(6))
dist = 0
for i, v in enumerate(A):
    for j in A[i:]:
        dist = j - v
        if dist > k:
            print(":(")
            sys.exit()

print("Yay!")

Solution (Python):


antenna = list(sorted([int(input().rstrip()) for i in range(5)]))

require = int(input().rstrip())

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

Solution (Python):
stdin = []
for x in range(6):
    stdin.append(int(input()))
a,b,c,d,e,k = (x for x in stdin)
ans = "Yay!"

for x in range(len(stdin)- 1):
    if x != len(stdin) - 2:
        for y in range(x+1,len(stdin)-1):
            if abs(stdin[x]-stdin[y]) > k:
                ans = ":("
print(ans)

Solution (Python):
abcde = []
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
abcde.append(int(input()))
k = int(input())

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

Solution (Python):



def main():
  xs = [int(input()) for i in range(5)]
  k = int(input())
  for i in range(len(xs)):
    for j in range(i+1, len(xs)):
      if xs[j] - xs[i] > k:
        print(':(')
        return
  print('Yay!')


if __name__=='__main__':
  main()

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=[]
for i in range(5):
	L.append(int(input()))
S=[]
for i in range (4):
	for j in range(i+1,5):
		S.append(abs(L[i]-L[j]))
K=int(input())
if max(S)<=K:
	print("Yay!")
else:
	print(":(")

Solution (Python):
l=[int(input()) for i in range(6)]
k=l.pop(-1)
l.sort()
if l[4]-l[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(":(")
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):
l = []
for _ in range(5):
    l.append(int(input()))
k = int(input())
l.sort()
if l[4] - l[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 max(a, b, c, d, e) - min(a, b, c, d, 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]
n = sorted(l)[4]-sorted(l)[0]

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

Solution (Python):
def main():
    array = []
    a = int(input())
    for _ in range(4):
        array.append(int(input()))
    k = int(input())

    for p in array:
        if p - a > k:
            print(":(")
            exit()
    print("Yay!")


if __name__ == "__main__":
    main()

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = [INT() for _ in range(5)]
k = INT()

a = sorted(a)

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

Solution (Python):
ls = sorted([int(input()) for _ in 'abcde'])
k = int(input())

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

Solution (Python):
a = [int(input()) for _ in range(6)]
print("Yay!") if a[-2] - a[0] < a[-1] + 1 else print(":(")

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

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

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

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

Solution (Python):

import sys


def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    X = (a, b, c, d, e)
    for i, x in enumerate(X):
        for xx in X[i+1:]:
            if abs(x - xx) > k:
                return ':('
    return 'Yay!'


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  
    b = int(next(tokens))  
    c = int(next(tokens))  
    d = int(next(tokens))  
    e = int(next(tokens))  
    k = int(next(tokens))  
    print(solve(a, b, c, d, e, k))

if __name__ == '__main__':
    main()

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

k = int(input())

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

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

Solution (Python):
from itertools import combinations
a2e = [int(input()) for i in range(5)]
k = int(input())

com = list(combinations(list(range(5)), 2))
ans = "Yay!"
for i in com:
    if abs(a2e[i[0]] - a2e[i[1]]) > k:
        ans = ":("
        break

print(ans)

Solution (Python):

D=[int(input()) for _ in range(5)]
k=int(input())
flg=all(abs(D[p]-D[q])<=k for p in range(0,5) for q in range(p+1,5))
print('Yay!' if flg else ':(')

Solution (Python):
a = [int(input())  for i in range(6)]
ans = "Yay!"
for i in range(5):
    for j in range(5):
        if i != j:
            if abs(a[i] - a[j]) > a[5]:
                ans = ":("
print(ans)

Solution (Python):



L_list = [int(input().strip()) for _ in range(5)]
k = int(input().strip())

L_list.sort()

flag=True
for i in range(1,len(L_list) ):
  if (L_list[i] - L_list[0]) > k:
    flag = False

if flag == True:
  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(":(")
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):
x =[int(input()) for i in range(5)]
k = int(input())

x_max = max(x)
x_min = min(x)

if x_max-x_min <= k:
    print("Yay!")
else:
    print(":(")

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

Solution (Python):

antenna_list = []
ans = "Yay!"

for _ in range(5):
    antenna = int(input())
    antenna_list.append(antenna)
    
k = int(input())
    
for i in range(4):
    if ans == ":(":
        break
    for j in range(i+1, 5):
        if abs(antenna_list[i] - antenna_list[j]) > k:
            ans = ":("
            break
            
print(ans)

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

list_1.sort(reverse=True)
ans = 0

for j in list_1:
    ind = list_1.index(j)
    while ind <= 3:
        ind += 1
        if k < j - list_1[ind]:
            ans += 1
        
if ans == 0:
    print('Yay!')
else:
    print(':(')

Solution (Python):
*a, k = [int(input()) for _ in range(6)]
can = True
for a1 in a:
    for a2 in a:
        if abs(a1 - a2) > k:
            can = False
print('Yay!' if can else ':(')

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

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

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

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

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

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

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

Solution (Python):
S=[int(input()) for i in range(5)]
K=int(input())

def antenna(s,k):
    while True:
        for i in range(5):
            for j in range(5):
                if i!=j:
                    if abs(s[i]-s[j])>k:
                        return ':('
        return 'Yay!'

print(antenna(S,K))

Solution (Python):
import sys
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
antena = [a,b,c,d,e]
state = 1
for i in range(len(antena)):
    for j in range(i+1,len(antena)):
        if antena[j]-antena[i]<=k:
            state = 1
        else:
            state = 0
            break
    if state == 0:
        print(":(")
        sys.exit()
print("Yay!")

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

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

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

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

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

m = min(a, b, c, d, e)
M = max(a, b, c, d, e)

if M - m > 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 k < e - a:
  print(':(')
else:
  print('Yay!')

Solution (Python):
import sys

inputs = [int(row.split()[0]) for row in sys.stdin.readlines()]

max_distance = inputs[-1]
antenna_list = inputs[:-1]

antenna_list = sorted(antenna_list)    

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

Solution (Python):
dentyu = []
for i in range(5):
    dentyu.append(int(input()))
k = int(input())
flag = False
for i in range(4):
    for j in range(i,5):
        if k < abs(dentyu[i]-dentyu[j]):
            flag = True
            break 
print('Yay!' if flag==False else ':(')

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

Solution (Python):



import itertools
li = []
for _ in range(5):
    li.append(int(input()))
di = int(input())
for a, b in itertools.combinations(li, 2):
    if abs(a - b) > di:
        print(":(")
        exit()
print("Yay!")

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

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

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

for i in range(len(antennas)):
  for j in range(len(antennas)):
    if(i != j and abs(antennas[i] - antennas[j]) > k):
      print(":(")
      exit()
print("Yay!")

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

    max_antena = max(a,b,c,d,e)
    min_antena = min(a,b,c,d,e)

    print('Yay!' if max_antena - min_antena <= k else ':(')

if __name__ == '__main__':
    main()

Solution (Python):
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = sys.stdin.readline

def eprint(s):
    if type(s) != type('str'):
        s=str(s)

    sys.stderr.write(s+'\n')
    return

def main():
    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!')
    return

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
antenna = [int(input()) for i in range(5)]
k = int(input())
ans = 'Yay!'
for i in range(5):
    for j in range(i):
        if abs(antenna[i]-antenna[j])>k:
            ans = ':('
print(ans)

Solution (Python):
r=[int(input()) for i in range(6)]
if r[4]-r[0]>r[5]:
  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())

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

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

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

for x, y in list(itertools.combinations([a, b, c, d, e], 2)):
    if y - x > k:
        print(':(')
        exit()
else:
    print('Yay!')

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

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

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

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

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

import itertools as it
x1 = list(it.combinations(range(5), 2))

ans = "Yay!"
for i,j in x1:
    if abs(a1[i] - a1[j]) > k:
        ans = ":("

print(ans)

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

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

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

Solution (Python):
import itertools

A = list(map(int,open(0).read().split()))
k = A.pop()

B = itertools.combinations(A, 2)

for a, b in B:
    if abs(a - b) > k:
        print(':(')
        break
else:
    print('Yay!')

Solution (Python):
A = list(map(int,open(0).read().split()))
k = A.pop()
 
ans = 'Yay!'
 
for i in range(len(A)-1):
    for j in range(i+1, len(A)):
        d = abs(A[i] - A[j])
        if d > k:
            ans = ':('
print(ans)

Solution (Python):
p = []

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

far = int(input())
res = True

for x in range(len(p)):
    for xx in range(x+1, len(p)):
        if p[xx] - p[x] > far:
            res = False

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

Solution (Python):

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

k = int(input())

x.sort()
r = x.pop()

for i in x:
    if r - i > k:
        print(':(')
        break
else:
    print('Yay!')

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
xs = [a, b, c, d, e]
result = 'Yay!'
for i in range(5):
    for j in range(i + 1, 5):
        if k < xs[j] - xs[i]:
            result = ':('
            break
print(result)

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

def answer():
  if e - a > k:
    return False
  return True

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

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

Solution (Python):




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


if __name__ == "__main__":
    main()

Solution (Python):
antennas=[]
for _ in range(5):
    antennas.append(int(input()))
k=int(input())
    
for i in range(5):
    for j in range(i+1,5):
        if antennas[j]-antennas[i]>k:
            print(":(")
            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):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

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

can = False
for i in range(len(list)):
  for j in range(len(list)):
    if i == j:
      continue
    if abs(list[i] - list[j]) <= k:
      can = True
    else:
      can = False
      break
      
if can:
  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):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
print('Yay!' if e-a <= k else ':(')

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

Solution (Python):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    L = [INT() for _ in range(5)]
    k = INT()

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


if __name__ == '__main__':
    main()

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

can = True

for i in antenna:
    for j in antenna:
        if i == j or i < j:
            continue
        else:
            if abs(i - j) > k:
                can = False
                break
            else:
                continue

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

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

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

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

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

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

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

Solution (Python):

lst = list(int(input()) for _ in range(6))

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

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):
import sys
def input(): return sys.stdin.readline().rstrip()

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

    for i in AtoE:
        for j in AtoE:
            if abs(i - j) > k:
                print(':(')
                exit()
    else:
        print('Yay!')

if __name__ == '__main__':
    main()

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

Solution (Python):
a=[ int(input()) for i in range(6)]
k=a[-1]
del a[-1]
for i in range(4):
  for j in range(i+1,5):
    if abs(a[i]-a[j])>k:
      print(":(")
      exit()
print("Yay!")

Solution (Python):

z=[]
ans=0
for i in range(5):
    z.append(int(input()))
k=int(input())

for i in range(4):
    for j in range(i+1,5):
        if k<(z[j]-z[i]):
            ans+=1
if ans:
    print(":(")
else:
    print("Yay!")

Solution (Python):
from itertools import combinations

A = [int(input()) for _ in range(5)]
K = int(input())

for x, y in combinations(A, 2):
  z = abs(x-y)
  if z > K:
    print(":(")
    exit()
print("Yay!")

Solution (Python):
import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

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

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

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

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

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
lis=[a,b,c,d,e]
lis.sort()

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

Solution (Python):
import itertools
p=list()
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
p.append(int(input()))
k=int(input())
c=list(itertools.combinations(p,2))
d=list()
for i in range(len(c)):
  d.append(c[i][1]-c[i][0])
if max(d)>k:
  print(':(')
else:
  print('Yay!')

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

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

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

if max(lst)-min(lst) <= int(input()):
  print('Yay!')
else:
  print(':(')

Solution (Python):
arr = [int(input()) for _ in range(6)]
arr, k = sorted(arr[:-1]), arr[-1]
print('Yay!' if arr[-1]-arr[0] <= k else ':(')

Solution (Python):
A= [int(input()) for i in range(6)]
answer = "Yay!"
for u in range(4):
  for s in range(u,5):
    if A[s] - A[u] > A[5]:
      answer = ":("
print(answer)

Solution (Python):
import sys
import math
import itertools

a=[]

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

for j in itertools.combinations(a,2):
	if a[5]<j[1]-j[0]:
		print(":(")
		sys.exit()

print("Yay!")

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

k = int(input())


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

Solution (Python):
N = []

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

ans = "Yay!"
for i in range(5):
    for j in range(i+1,5):
        dist = abs(N[j] - N[i])
        
        if dist > N[5]:
            ans = ":("

print(ans)

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

i = e-a

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

Solution (Python):
antena = [int(input()) for _ in range(5)]
k = int(input())
for i in range(5):
    for j in range(i + 1, 5):
        a = antena[i]
        b = antena[j]
        if b - a > k:
            print(':(')
            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):
l = [int(input()) for i in range(6)]
print(['Yay!',':('][l[4]-l[0]>l[5]])

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

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

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

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

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

Solution (Python):
x=[int(input()) for _ in range(6)]
f=True
for i in range(5):
    for k in range(i,5):
        if x[k]-x[i]>x[5]:
            f=False
            break
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())

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

Solution (Python):

 
import math
import itertools
import sys
import copy
 







sub = 0
a = int(input())
x = int(input())
x = int(input())
x = int(input())
e = int(input())

k = int(input())

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

Solution (Python):
A=list(int(input()) for _ in range(6))

if A[-2]-A[0]>A[-1]:
    print(":(")
else:
    print("Yay!")

Solution (Python):
import sys

*x, k = map(int, sys.stdin.read().split())

def main():
    x.sort()
    return 'Yay!' if x[-1] - x[0] <= k else ':(' 

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

Solution (Python):
max_dis = 0
a = int(input())
for _ in range(3):
    input()
b = int(input())
k = int(input())
if b - a <= k:
    print("Yay!")
else:
    print(":(")

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

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

Solution (Python):
a=[0]*5
for i in range(5):
  a[i]=int(input())
k=int(input())
ans=True
for i in range(4):
  for j in range(i+1,5):
    if a[j]-a[i]>k:
      ans=False
if ans:
  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(':(')
else:
    print('Yay!')

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

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


if __name__ == '__main__':
    main()

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]
if(max(array)-min(array) <= k):
    print("Yay!")
else:
    print(":(")