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())
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 math
import collections
import sys

input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

num=[]
for i in range(5):
    num.append(I())
k=I()
if num[-1]-num[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):
city = [int(input()) for _ in range(5)]
k = int(input())
count = 0
for i in range(4):
  for j in range(i+1,5):
    if city[j]-city[i]>k:
      print(':(')
      exit()
print('Yay!')

Solution (Python):
aru = False
antenas = []
for i in range(5):
  k=int(input())
  antenas.append(k)
k=int(input())
for i in range(5):
  for t in range(i,5):
    if abs(antenas[i]-antenas[t])>k:
      aru = True
if aru:
  print(':(')
else:
  print("Yay!")

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

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

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

max_dist = int(input())

coords = {}

for i in range(len(antennas)):
  coords[i] = antennas[i]
flag = 1
for i in range(5):
  for j in range(i + 1, 5):
    if abs(coords[i] - coords[j]) > max_dist:
      print(':(')
      flag = 0
      break
  if flag == 0:
    break
if flag == 1:
  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,b,c,d,e,k=[int(input())for _ in range(6)]

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

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

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

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline









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

print("Yay!" if max(A)-min(A) <= K else ":(")

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

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

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

line=[]

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

k = int(input())

out = "Yay!"

for i in range(5):
    for j in range(4-i):
        tmp = line[i] - line[j+1]

        if abs(tmp) > k:
            out = ":("

    if out == ":(":
        break

print(out)

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

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

Solution (Python):
a = int(input())
for _ in range(3):
    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())
f = int(input())
 
 
if (e - a <= f):
    print("Yay!")
else:
    print(":(")

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

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

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

print("Yay!")

Solution (Python):














rows = [int(input()) for _ in range(6)]
k = rows.pop()

ans = "Yay!"
for i,v in enumerate(rows):
    for j in range(i+1,5):
        if rows[j] - v > k:
            ans = ":("
            break

print(ans)

Solution (Python):
L = []
for i in range(6):
    L.append(int(input()))
if (L[4] - L[0]) <= L[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())
A=b-a
B=c-a
C=d-a
D=e-a
F=c-b
G=d-b
H=d-c
I=e-b
J=e-c
K=e-d
if k>=A and k>=B and k>=A and k>=C and k>=D and k>=F and k>=G and k>=H and k>=I and k>=J and k>=K:
    print("Yay!")
else:
    print(":(")

Solution (Python):
line2 = []
for i in range(5):
    line = int(input())
    line2.append(line)
long = int(input())
if line2[4] - line2[0] <= long:
    print("Yay!")
else:
    print(":(")

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

antena=[a,b,c,d,e]
antena.sort()

if antena[4]-antena[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 max(a,b,c,d,e)-min(a,b,c,d,e)<=k:
  print('Yay!')
else:
  print(':(')

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

Solution (Python):
import numpy as np
import sys
readline = sys.stdin.readline
read = sys.stdin.read

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

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

Solution (Python):
*l, k = map(int, open(0).read().split())
from itertools import permutations as pr
print(":(" if any(abs(i) > k for i in map(lambda x: x[0]-x[1], list(pr(l)))) else "Yay!")

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

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

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

Solution (Python):
N = [0]*5
N = [int(input()) for x in range(5)]
k = int(input())
for i in range(4):
  for j in range(i,5):
    if k < N[j]-N[i]:
      print(':(')
      exit()
print('Yay!')

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):
antannas = [int(input()) for _ in range(5)]
k = int(input())
count = 0
for i in range(5):
    for j in range(i+1, 5):
        if antannas[j] - antannas[i] <= k:
            count += 1
if count == 10:
    print("Yay!")
else:
    print(":(")

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

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

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
lis=[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-e),abs(d-e)]
lis2=sorted(lis)
if lis2[-1]<=k:
    print("Yay!")
else:
    print(":(")

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

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

List = sorted(List)

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

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

isExist = False

for i in range(5):
    for j in range(i, 5):
        if abs(a[i] - a[j]) > k:
            isExist = True

print('Yay!' if not isExist else ':(')

Solution (Python):
def main():
    l = [int(input()) for i in range(5)]
    k = int(input())
    if(l[-1]- l[0]> k):
        print(":(")
    else:
        print("Yay!")
if __name__ == '__main__':
    main()

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

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

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect




from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')

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

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

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

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

p = a[:5]

if max(p) - min(p) > a[-1]:
    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
import fractions
def main():
  L = [] * 5
  a = L.append(int(input()))
  b = L.append(int(input()))
  c = L.append(int(input()))
  d = L.append(int(input()))
  e = L.append(int(input()))
  k = int(input())
  ans = 'Yay!'
  for n,m in itertools.combinations(L,2):
    if abs(n-m) <= k:
      pass
    else:
      ans = ':('
      break
  print(ans)

if __name__ == '__main__':
  main()

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

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

def combination(n, m):
    return m - n

if combination(a, b) > k or combination(a, c) > k or combination(a, d) > k or combination(a, e) > k:
    print(":(")
else:
    print("Yay!")

Solution (Python):
a=[int(input()) for _ in range(5)]
k=int(input())
ans="Yay!"
for p in a:
    for q in a:
        if abs(p-q)>k:
            ans=":("
print(ans)

Solution (Python):
l = [int(input()) for i in range(6)]
cnt = 0
for i in range(5):
    for j in range(i, 5):
        if l[j] - l[i] > l[5]:
            cnt += 1
if cnt == 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())

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

Solution (Python):
a = int(input())
input()
input()
input()
e = int(input())
k = int(input())

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

Solution (Python):
import sys

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

def main():
    ans = 'Yay!' if x[-1] - x[0] <= k else ':('
    print(ans)

if __name__ ==  '__main__':
    main()

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

Solution (Python):
from itertools import combinations
import sys

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

for i in combinations(x,2):
    tmp = abs(int(i[0])-int(i[1]))
    if(tmp > k):
        print(':(')
        sys.exit()
print('Yay!')

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a =[]
    for i in range(6):
        s = int(input())
        a.append(s)

    flag =0

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

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
a=ii()
b=ii()
c=ii()
d=ii()
e=ii()
k=ii()

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

antennas=[a,b,c,d,e]
def check():
    for i in range(0,4):
        for j in range(1,5):
            if antennas[j]-antennas[i]>k:
                print(':(')
                return None
    print('Yay!')

check()

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

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

judge = 'Yay!'
diff = coordinate[-1] - coordinate[0]

if (diff > k):
    judge = ':('

print(judge)

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):
li = [int(input()) for _ in range(5)]
k = int(input())
for i in range(5):
    for j in range(i + 1, 5):
        if li[j] - li[i] > k:
            print(":(")
            exit()
print("Yay!")

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

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

Solution (Python):
import sys

*antennas, k = map(int, sys.stdin.read().split())
num = 0
for i in range(4):
    for j in range(i+1, 5):
        if abs(antennas[i] - antennas[j]) > k:
            num += 1
print(':(' if num else 'Yay!')

Solution (Python):
ae = [int(input()) for _ in range(5)]
ae.sort()
if ae[-1] - ae[0] <= 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 max(e-d,d-c,c-b,b-a,e-c,d-b,c-a,e-b,d-a,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):
d = [int(input()) for i in range(5)]
k = int(input())
all_dis  = []
for i in range(4):
    for j in range(i+1,5):
        all_dis.append(d[j]-d[i])
for i in all_dis:
    if i > k:
        print(':(')
        exit()
print('Yay!')

Solution (Python):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

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

if max(x) - min(x) <= 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):
def main():
  
  
  
  
  
  a = [int(input()) for i in range(6)]
  ans = 0
  
  
  if a[4] - a[0] > a[5]:
    print(":(")
    exit()
  print("Yay!")
  
if __name__ == '__main__':
  main()

Solution (Python):
i = 0
zahyou = []
while i<6:
    zahyou.append(int(input()))
    i +=1
print('Yay!' if zahyou[4]-zahyou[0] <= zahyou[5] else ':(')

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


import itertools

flag = True
for v1, v2 in itertools.combinations(antenna, 2):
    if abs(v1 - v2) > k:
        flag = False
        break

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

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

Solution (Python):

v = [int(input()) for i in range(5)]
a = int(input())
for i in range(0 , 5) :
    for j in range(1 ,5) :
        if v[j] - v[i] > a:
            print(':(')
            quit()
else :
    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 b-a<=k and c-b<=k and d-c<=k and e-d<=k and 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 (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 = list(int(input()) for i in range(5))
k = int(input())


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

Solution (Python):
flag = "ok"
list_A = [i for i in range(6)]
for i in range(6):
  list_A[i] = int(input())
for j in range(5):
  for l in range(5):
    if (list_A[j]-list_A[l]) > list_A[5]:
      flag = "ng"
if flag == "ok":
  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,b,c,d,e,k=[int(input()) for i in range(6)]
print("Yay!" if e-a<=k else ":(")

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

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

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

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

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

if l[4]-l[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('Yay!')
else:
    print(':(')

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

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

for i in range(4):
    for j in range(i+1, 5):
        
        if abs(cities[i] - cities[j]) > k:
            print(":(")
            exit()
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):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
d11 = b - a
d12 = c - a
d13 = d - a
d14 = e - a
d21 = c - b
d22 = d - b
d23 = e - b
d31 = d - c
d32 = e - c
d41 = e - d
if d11 <= k and d12 <= k and d13 <= k and d14 <= k and d21 <= k and d22 <= k and d23 <= k and d31 <= k and d32 <= k and d41 <= k:
  print('Yay!')
else:
  print(':(')

Solution (Python):
v = [int(input()) for _ in range(5)]
k = int(input())
if max(v) - min(v) <= 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(":(")
elif e - b > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > 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(":(")
elif e - b > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > 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 b - a > k:
    print(":(")
elif c - a > k:
    print(":(")
elif d - a > k:
    print(":(")
elif e - a > k:
    print(":(")
elif c - b > k:
    print(":(")
elif d - b > k:
    print(":(")
elif e - b > k:
    print(":(")
elif d - c > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > 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())
atoe = [a, b, c, d, e]
flag = True
for i in atoe:
    if not flag: break
    for j in atoe:
        if abs(i-j) > k:
            flag = False
            print(':(')
            break
if flag:
    print('Yay!')

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

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

Solution (Python):
ans = [int(input()) for _ in range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')

Solution (Python):


def main():

    antennas = []
    for _ in range(5):
        char = int(input())
        antennas.append(char)
    
    k = int(input())
    result = 'Yay!'
    
    for antenna in antennas[::-1]:
        if antenna - antennas[0] > k:
            result = ':('
            break
    
    print(result)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
an = list(int(input()) for _ in range(5))
k = int(input())

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

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

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

Solution (Python):
for i in range(5):
  if i == 0:
    a = int(input())
  elif i == 1 or i == 2 or i == 3:
    tmp = int(input())
  else:
    b = int(input())
k = int(input())
if k >= b - a:
  print("Yay!")
else:
  print(":(")

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

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

Solution (Python):
antenna = []
N = 5
for _ in range(N):
    antenna.append(int(input()))
k = int(input())
ans = 'Yay!'
for i in range(N - 1):
    for j in range(1, N):
        if antenna[j] - antenna[i] > k:
            ans = ':('
            break
print(ans)

Solution (Python):
x=[0]*5
k=0
for i in range(5):
	x[i]=int(input())
t=int(input())
x.sort()

if x[0]+t<x[4]:
	print(':(')
else:
	print('Yay!')

Solution (Python):
N = 5
List = [int(input()) for _ in range(N)]
K = int(input())

flag = 0

for i in range(N-1):
    for j in range(i+1,N):
        k = List[j]-List[i]
        
        if k>K:
            flag=1
            break

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

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

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

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

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

Solution (Python):
a = 0
b = 0
k = 0
for i in range(6):
  t = int(input())
  if(i == 0):
    a = t
  elif(i == 4):
    b = t
  elif(i == 5):
    k = t

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

Solution (Python):
k = 0
a = 0
b = 0
for i in range(6):
  t = int(input())
  if(i == 0):
    a = t
  elif(i == 4):
    b = t
  elif(i == 5):
    k = t

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

Solution (Python):
a,*_,e,k=map(int,open(0))
print('Y:a(y !'[e-a>k::2])

Solution (Python):
from itertools import combinations as comb
import sys


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

    pair_antenna = list(comb(antennas, 2))
    for pair in pair_antenna:
        diff = pair[1] - pair[0]
        if diff > k:
            print(":(")
            sys.exit(0)
    print("Yay!")


if __name__ == "__main__":
    main()

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

answer = "Yay!"

for i in range(4):
    if max(a)-min(a) > k:
        answer = ":("

print(answer)

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

answer="Yay!"

for i in range(4):
    if max(a)-min(a)>k:
        answer=":("

print(answer)

Solution (Python):
li = []

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

k = int(input())

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

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

flag = False
for i in range(5):
    for j in range(5):
        if i == j:
            continue
        if abs(A[i] - A[j]) <= k:
            continue
        flag = True

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

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ls = [a,b,c,d,e]
print('Y:a(y !'[max(ls)-min(ls)>k::2])

Solution (Python):
A = [int(input()) for _ in range(5)]
k = int(input())
if max(A) - min(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())

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

Solution (Python):

antenna = [0] * 5

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

k = int(input())
judge = 0
for i in range(5):
    for j in range(i + 1, 5):
        if abs(antenna[i] - antenna[j]) > k:
            judge = 1
            break

print(":(" if judge == 1 else "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):
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    *line, k = [int(sys.stdin.readline().rstrip()) for _ in range(6)]
    print(':(' if max(line) - min(line) > k else 'Yay!')


if __name__ == '__main__':
    main()

Solution (Python):

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

for v in itertools.combinations([a,b,c,d,e],2):
    if (abs(v[1]-v[0])>k):
        print(":(")
        exit()

print("Yay!")

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

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

if max(l) - min(l) > 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())


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