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):
import sys
a=list(map(int,open(0).read().split()))
for i in range(5):
  for j in range(5):
    if i==j:
      continue
    elif abs(a[i]-a[j])>a[5]:
      print(':(')
      sys.exit()
else:
  print('Yay!')

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

check="Yay!"
for i in range(4):
    for j in range(1,5-i):
       
        if arr[i+j]-arr[i]>k:
            check=":("
            break
    if check==":(":
        break
print(check)

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

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

Solution (Python):
import sys
d = [int(input()) for i in range(6)]
 
def check():
    for i in range(5):
        for j in range(5):
            if abs(d[i]-d[j]) > d[5]:
                print(":(")
                sys.exit()
    print("Yay!")
         
check()

Solution (Python):
import sys
d = [int(input()) for i in range(6)]

def check():
    for i in range(5):
        for j in range(5):
            if abs(d[i]-d[j]) > d[5]:
                print(":(")
                sys.exit()
    print("Yay!")
         
check()

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

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

x=max(a,b,c,d,e)
y=min(a,b,c,d,e)


if x-y>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):
import itertools


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


max_distance = e - a

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

Solution (Python):
import itertools


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

combs = itertools.combinations([a, b, c, d, e], 2)

can_connects = [abs(x[0] - x[1]) <= k for x in combs]

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

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

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

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

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

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

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

Solution (Python):
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
ans = 0
for i in range(4):
    for j in range(i+1, 5):
        if a[j] - a[i] > k:
            ans = 1
if ans == 1:
    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())

arr1 = [a, b, c, d, e]
arr2 = [b, c, d, e]
f = 0
for x, y in itertools.product(arr1, arr2):
  if abs(x - y) > k:
    f += 1
if f == 0:
  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 print (":(")

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

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

Solution (Python):
abcdek=[]
for i in range(6):
  abcdek.append(int(input()))
ans="Yay!"
k=abcdek[5]
for i in range(5):
  p=abcdek[i]
  for j in range(i+1,5):
    q=abcdek[j]
    if q-p>k:
      ans=":("
      break
print(ans)

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

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

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

flag = "Yay!"
for i in range(4):
    for j in range(i+1, 5):
        d = l[j]-l[i]
        
        if d>l[-1]:
            flag = ":("
print(flag)

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

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

Solution (Python):

import sys

read= sys.stdin.buffer.read
l= list(map(int, open(0).read().split()))

if (max(l[:5])-min(l[:5]))>l[5]:print(':(')
else:print('Yay!')

Solution (Python):
x = [0]*5

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

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

Solution (Python):
a,b,c,d,e,k=(int(input())for _ in range(6))
print('Y:a(y !'[e-a>k::2])

Solution (Python):


import itertools

abcdek = [int(input()) for _ in range(6)]


for i, j in itertools.combinations(range(5), 2):
    num1, num2 = abcdek[i], abcdek[j]
    if num2-num1 > abcdek[-1]:
        print(":(")
        exit()


print("Yay!")

Solution (Python):
import sys

import math


from collections import deque

from fractions  import gcd

input=sys.stdin.readline
x=[int(input()) for _ in range(5)]
k=int(input())

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

Solution (Python):
def main():
  num = [int(input()) for i in range(5)]
  n =int(input())
  flg=0
  for i in range(0,4):
    for j in range(i,5):
      if abs(num[j]-num[i])>n :
        flg=1
        break
  if flg==0 :
    print('Yay!')
  else :
    print(':(')

main()

Solution (Python):
l=[int(input()) for _ in range(5)][::-1]
k=int(input())
for i,a in enumerate(l):
    for b in l[i+1:]:
        if a-b>k:
            print(':(')
            exit()
print('Yay!')

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

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

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

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

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

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

Solution (Python):
a=int(input());input();input();input();e=int(input());
if e - a <= int(input()):
  print('Yay!')
else:
  print(':(')

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
li = [I() for _ in range(6)] 
if (li[4] - li[0]) <= li[5]:
    print('Yay!')
else:
    print(':(')

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

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

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

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

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

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

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

Solution (Python):
antennas = [int(input()) for _ in range(5)]
distance = int(input())
antennas_distance = abs(sorted(antennas)[len(antennas)-1] - sorted(antennas)[0])
print(':(' if antennas_distance > distance else 'Yay!')

Solution (Python):
antennas = [int(input()) for _ in range(5)]
distance = int(input())
antennas.sort()
antennas_distance = abs(antennas[len(antennas)-1] - antennas[0])
print(':(' if antennas_distance > distance else 'Yay!')

Solution (Python):
antennas = []
distance = 0
for _ in range(5):
  antennas.append(int(input()))
distance = int(input())
for i in range(len(antennas)):
  for j in range(i+1, len(antennas)):
    if distance < abs(antennas[i] - antennas[j]):
      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 (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 = [int(input()) for _ in range(5)]
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())
result='Yay!'
q=[a,b,c,d,e]
for i in q:
    for x in q:
        if i-x>k:
            result=':('
print(result)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
result='Yay!'
r=[a,b,c,d,e]
for i in r:
    for x in r:
        if i-x>k:
            result=':('
print(result)

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

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


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

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

import itertools

d=[]

for v in itertools.combinations(l,2):
    d.append(abs(v[0]-v[1]))

if max(d)>k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
*l,k=map(int,open(0))
print('Yay!' if max(l)-min(l)<=k else ':(')

Solution (Python):
A = int(input())
B = int(input())
B = int(input())
B = int(input())
B = int(input())
K = int(input())
if B-A <= K:
    print('Yay!')
else:
    print(':(')

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

Solution (Python):
a = int(input())
ma = a
mi = a
for i in range(4):
  x = int(input())
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi <= int(input()):
  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):
from itertools import combinations


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

k = int(input())


pattern = list(combinations(antennas, 2))
max_len = max(
    [
        abs(i - j)
        for i, j in pattern
    ]
)
if max_len <= k:
    print("Yay!")
else:
    print(":(")

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

Solution (Python):
def main():
    K = [int(input()) for i in range(5)]
    k = int(input())
    ans = True
    for i in range(5):
        for j in range(i + 1, 5):
            if K[j] - K[i] > k:
                ans = False
                break

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


if __name__ == "__main__":
    main()

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

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

def check():
    if A[-2]-A[0]>A[-1]:
        return ':('
    return 'Yay!'
print(check())

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

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

Solution (Python):
import numpy as np
a = np.array([int(input()) for _ in range(5)])
k = int(input())

bl = a.max() - a.min() <= k

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

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

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

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

Solution (Python):
from itertools import combinations
L  = []
for i in range(5):
    L.append(int(input()))
k = int(input())
for i,j in combinations(L,2):
    if abs(i-j) > k:
        print(":(")
        break
else:
    print("Yay!")

Solution (Python):
import itertools
import math
import fractions
import functools
import copy

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

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

Solution (Python):
a = []
for _ 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(0)
print("Yay!")

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

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a = ii()
    for _ in range(3):
        ii()
    e = ii()
    k = ii()
    print('Yay!') if e - a <= k else print(':(')


if __name__ == "__main__":
    main()

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

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

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

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

k = int(input())

from itertools import combinations

c = list(combinations(Anntena,2))

flg=0
for a in c:
    dist = abs(a[1] - a[0])

    if dist>k:
        flg+=1

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

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):
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
def main():
    a=I()
    b=I()
    c=I()
    d=I()
    e=I()
    k=I()
    yn= 'Yay!' if e-a<=k else ':('
    print(yn)
    

if __name__ == '__main__':
    main()

Solution (Python):
A=[]
for i in range(5):
    a=int(input())
    A.append(a)
A.sort()
k=A[4]-A[0]
K=int(input())
if k<=K:
    print("Yay!")
else:
    print(":(")

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

ans = 'Yay!'
for i in range(len(distances) - 1):
    for j in range(i + 1, len(distances)):
        if k < abs(distances[i] - distances[j]):
            ans = ':('
            
print(ans)

Solution (Python):

from itertools import combinations
import sys


def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    print(":(" if any(
        abs(x1 - x2) > k
        for x1, x2 in combinations([a, b, c, d, e], 2)
    ) else "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))  
    solve(a, b, c, d, e, k)


if __name__ == '__main__':
    main()

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)





l = inputILs(6)

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

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

flag = True

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

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

Solution (Python):
import sys
import math
import bisect

def main():
    A = []
    for i in range(5):
        A.append(int(input()))
    m = int(input())
    ans = 'Yay!'
    for i in range(len(A)):
        for j in range(len(A)):
            if abs(A[i] - A[j]) > m:
                ans = ':('
    print(ans)
    
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):
abcde = [int(input()) for _ in range(5)]
k = int(input())
ans = 0
for i in range(4):
    for j in range(i+1,5):
        if abcde[j] - abcde[i] > k:
            ans += 1
if ans == 0:
    print('Yay!')
else:
    print(':(')

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


A = IR(5)
k = I()
for x, y in combinations(A, 2):
    if abs(x-y) > 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):
from itertools import combinations

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

distances = [abs(p1 - p2) for p1, p2 in combinations(positions, 2)]
result = all([d <= k for d in distances])

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

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

Solution (Python):
l=[int(input()) for i in range(6)]
k=l[5]
c=0
for i in range(4):
    for j in range(i+1,5):
        if abs(l[j]-l[i])<=k:
            c+=1
if c==10:
    print("Yay!")
else:
    print(":(")

Solution (Python):
a = []
for i in range(5):
    tmp = input()
    a.append(int(tmp))
k = int(input())
ans = True
for i in range(len(a)):
    for j in range(i, len(a)):
        if(a[j] - a[i] > k):
            ans = False
if ans:
    print("Yay!")
else:
    print(":(")

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

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

from itertools import permutations, combinations,combinations_with_replacement,product
ls = [a,b,c,d,e]
comb = list(combinations(ls,2))

flag=0
for i in range(10):
    sa = abs(comb[i][1] - comb[i][0])
    if sa > k:
        flag=1

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

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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



if __name__ == "__main__":
    main()

Solution (Python):
import sys
from itertools import combinations

input = sys.stdin.readline


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

    ans = "Yay!"
    for p, q in combinations([a, b, c, d, e], 2):
        if abs(p - q) > k:
            ans = ":("

    print(ans)


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 = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
mi = min(a, b, c, d, e)
ma = max(a, b, c, d, e)
if ma - mi > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
input_list = [int(input()) for i in range(5)]
k = int(input())
for i in range(1, 5):
    if abs(input_list[0] - input_list[i] ) > k:
        print(":(")
        exit()
for i in range(2, 5):
    if abs(input_list[1] - input_list[i]) > k:
        print(":(")
        exit()
for i in range(3, 5):
    if abs(input_list[2] - input_list[i]) > k:
        print(":(")
        exit()
for i in range(4, 5):
    if abs(input_list[3] - input_list[i]) > k:
        print(":(")
        exit()
print("Yay!")

Solution (Python):
def ABC_123_A():

    a = [0 for i in range(6)]

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

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

if __name__ == '__main__':

    ABC_123_A()

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

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

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

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()) for i in range(5)]
k = int(input())
ans = "Yay!"
for ai in a:
  for aj in a:
    if ai-aj > k:
      ans = ":("
print(ans)

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

Solution (Python):
import itertools

if __name__ == "__main__":
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())
    l_an = [a, b, c, d, e]
    ret = "Yay!"
    for i in list(itertools.combinations(l_an, 2)):
        if i[1] - i[0] > k:
            ret = ":("
            break
    print(ret)

Solution (Python):
import math
a=[int(input()) for i in range(5)]
b=int(input())
count=0
for i in a:
  for j in a:
    if math.fabs(i-j)>b:
      count+=1
    else:
      continue
if count!=0:
  print(':(')
else:
  print('Yay!')

Solution (Python):
import itertools
import math

antena = []
antena.append(int(input()))
antena.append(int(input()))
antena.append(int(input()))
antena.append(int(input()))
antena.append(int(input()))
k = int(input())
for v in itertools.combinations(antena, 2):
    if v[1] - v[0] > k:
        print(":(")
        quit()
print('Yay!')

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

if (max(A)-min(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()) for _ in range(5)]
k = int(input())
ans = 'Yay!'
for i in range(len(A)):
    for j in range(len(A)):
        if i == j:
            continue
        if abs(A[i] - A[j]) > k:
            ans = ':('
print(ans)

Solution (Python):



d = []
for _ in range(5):
    d.append(int(input()))
if max(d) - min(d) <= int(input()):
    print("Yay!")
else:
    print(":(")

Solution (Python):
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
for x,y in itertools.permutations([a,b,c,d,e],2):
    if x-y > 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())
print('Yay!' if (e - a) <= k else ':(')

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

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