Problem:


﻿Score: 100 points

Problem Statement

In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.

Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.

Determine if there exists a pair of antennas that cannot communicate directly.

Here, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.  

Constraints

a, b, c, d, e and k are integers between 0 and 123 (inclusive).

a < b < c < d < e

Input

Input is given from Standard Input in the following format:

a
b
c
d
e
k

Output

Print :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.

Sample Input 1

1
2
4
8
9
15

Sample Output 1

Yay!

In this case, there is no pair of antennas that cannot communicate directly, because:

the distance between A and B is 2 - 1 = 1

the distance between A and C is 4 - 1 = 3

the distance between A and D is 8 - 1 = 7

the distance between A and E is 9 - 1 = 8

the distance between B and C is 4 - 2 = 2

the distance between B and D is 8 - 2 = 6

the distance between B and E is 9 - 2 = 7

the distance between C and D is 8 - 4 = 4

the distance between C and E is 9 - 4 = 5

the distance between D and E is 9 - 8 = 1

and none of them is greater than 15. Thus, the correct output is Yay!.

Sample Input 2

15
18
26
35
36
18

Sample Output 2

:(

In this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.
Thus, the correct output is :(.



Sample input:
1
2
4
8
9
15


Sample output:
Yay!

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(5):
  for j in range(5):
    ans = abs(a[i] - a[j])
    b.append(ans)

c = 0
for i in b:
  if i > k:
    c += 1

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

Submission status: Accepted

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

list=[]
list.append(a)
list.append(b)
list.append(c)
list.append(d)
list.append(e)

yes="Yay!"
no=":("
flag=False

for i in range(5):
    for j in range(5):
        if i==j or i>j:
            continue
        if k<list[j]-list[i]:
            flag=True
if flag:
    print(no)
else:
    print(yes)

Submission status: Accepted

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

Submission status: Accepted

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

maxima = values[4] - values[0]

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

Submission status: Accepted

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

Submission status: Accepted

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

ret = ':('
if inputList[4] - inputList[0] <= k:
    ret = 'Yay!'

print(ret)

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

Solution code:
li=[]
for i in range(0,5):
  a=int(input())
  li.append(a)
base=int(input())
if max(li)-min(li)<=base:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = [int(input()) for i in range(5)]
k = int(input())
leg = num[4]-num[0]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
dic = {}
for antenna in ["A", "B", "C", "D", "E"]:
    dic[antenna] = int(input())
distant = int(input())

flg = False
for i in dic.keys():
    for j in dic.keys():
        if abs(dic[j] - dic[i]) > distant:
            flg = True
            break

if flg == True:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
sm = float('inf')
bi = - float('inf')
for _ in range(5):
    v = int(input())
    if v < sm: sm = v
    if v > bi: bi = v

if bi - sm > int(input()): print(':(')
else: print('Yay!')

Submission status: Accepted

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

flag = "Yay!"
if li[4] - li[0] > li[5]:
    flag = ":("

print(flag)

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(5)]
k = int(input())
print('Yay!' if all(a[i] - a[j] <= k for i in range(5) for j in range(i)) else ':(')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main() -> None:
    num = [int(input()) for _ in range(5)]
    k = int(input())
    if max(num) - min(num) <= k:
        print('Yay!')
    else:
        print(':(')


if __name__ == '__main__':
    main()

Submission status: Accepted

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


k = int(input())

def diff(x, y, z = k):
  if abs(x - y) > z:
    return 1
  else:
    return 0
  
num = 0

num += diff(a, e)
num += diff(a, d)
num += diff(a, c)
num += diff(a, b) 
num += diff(b, e)
num += diff(b, d)
num += diff(b, c)
num += diff(c, e)
num += diff(c, d)
num += diff(d, e)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

k = int(input())
l.sort()
if l[-1] - l[0] > k: print(':(')
else: print('Yay!')

Submission status: Accepted

Solution code:

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

k = int(input())

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

Submission status: Accepted

Solution code:
from itertools import combinations

li_ant = list()

for _ in range(5):
    li_ant.append(int(input()))

k = int(input())

if all([abs(cmb[0] - cmb[1]) <= k for cmb in combinations(li_ant, 2)]):
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

ans = 'Yay!'
for i in a:
    for j in a:
        if abs(i - j) > k:
            ans = ':('
print(ans)

Submission status: Accepted

Solution code:
a = []
for i in range (5):
  a += [int(input())]
k = int(input())
a.sort()
kekka = ":("
if a[4] - a[0] <= k:
  kekka = "Yay!"
print(kekka)

Submission status: Accepted

Solution code:

a = int(input()) #iを取得し、intに値を入れる
b = int(input()) #iを取得し、intに値を入れる
c = int(input()) #iを取得し、intに値を入れる
d = int(input()) #iを取得し、intに値を入れる
e = int(input()) #iを取得し、intに値を入れる
k = int(input()) #iを取得し、intに値を入れる

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input_list = []
for line in sys.stdin:
    input_list.append(int(line))
k = input_list.pop(-1)

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

Submission status: Accepted

Solution code:
# coding = utf-8
list1 = []

for n in range(6):

    list1.append(int(input()))

count = 0

for city1 in list1[:5]:
    for city2 in list1[:5]:
        if (city1 - city2 > list1[5] or city2 - city1 > list1[5]):
            print ':('
            count += 1
            break
    if count != 0:
        break
if count == 0:
    print 'Yay!'

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
f=[a,b,c,d,e]
ma=max(f)
mi=min(f)
if ma-mi>k:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ant=[a,b,c,d,e]
f=False

for i in range(0,5):
    for ii in range(i+1,5):
        sa=ant[i]-ant[ii]
        if -sa<=k:
            continue
        else:
            print(":(")
            f=True
            break
    break

if f is False:
    print("Yay!")

Submission status: Accepted

Solution code:
import sys

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 isDisConnected(i, j):
    if abs(i - j) > k:
        return True
    return False

idx1 = 0
while(True):
    idx2 = idx1 + 1
    if idx1 == 5:
        break
    while(idx2 < 5):
        if isDisConnected(antennas[idx1], antennas[idx2]):
            print(":(")
            sys.exit()
        idx2 += 1
    idx1 += 1

print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
ant = [a, b, c, d, e]
f = False

for i in range(0, 5):
    for ii in range(i + 1, 5):
        sa = ant[i] - ant[ii]
        if -sa <= k:
            continue
        else:
            print(":(")
            f = True
            break
    break

if f is False:
    print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

a = inn()
b = inn()
c = inn()
d = inn()
e = inn()
k = inn()
print(':(' if e-a > k else 'Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# print(a)
# print(e)
# print(k)

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

Submission status: Accepted

Solution code:
lst = []
for i in range(0, 5):
	lst.append(int(raw_input()))
k = int(raw_input())
ans = 'Yay!'
for i in range(0, 5):
	for j in range(i+1, 5):
		if lst[j]-lst[i] > k:
			ans = ':('
print ans

Submission status: Accepted

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

K = int(input())

Yay_juge = 1
for j in range(5) :
    for m in range(5) :
        Antennas_juge = abs(Antennas_int[j] - Antennas_int[m])
        if Antennas_juge > K:
            Yay_juge = 0
            break

if Yay_juge == 1 :
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

mx = 0

mn = 124
mx = 0
for i in range(5):
    tmp = int(sys.stdin.readline())
    mn = min(mn, tmp)
    mx = max(mx, tmp)

if (mx-mn) > int(sys.stdin.readline()):
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yay!")
    else:print(":(")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
#n = ip()                                     #入力整数1つ
#n,q= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#b = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
a=[ip() for i in range(5)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
n = ip()
for i in range(5):
    for k in range(5):
        if a[k]-a[i] > n: j(0)
j(1)

Submission status: Accepted

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

Submission status: Accepted

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

if List[4] - List[0] > List[5] :
    print(":(")
    sys.exit()

print("Yay!")

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
print("Yay!" if max(a,b,c,d,e)-min(a,b,c,d,e) <= k else ":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
lst = []
for i in range(6):
    lst.append(int(input()))
k = lst.pop(-1)
comb = list(itertools.combinations(lst, 2))
c = 0
ans = 'Yay!'
for l in range(len(comb)):
    a = comb[l][0]
    b = comb[l][1]
    if a < b:
        if b - a > k:
            c += 1
    else:
        if a - b > k:
            c += 1
if c != 0:
    ans = ':('
print(ans)

Submission status: Accepted

Solution code:
list_a2e = [int(input()) for _ in range(5)]
k = int(input())
dist = list_a2e[4] - list_a2e[0]

ans = ":("
if dist <= k:
    ans = "Yay!"

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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


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

    for a in alpha:
        for b in alpha:
            if abs(a - b) > k:
                print(':(')
                exit()

    print('Yay!')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

frag = True
for i in range(5):
    for j in range(5):
        if abs(antena[i] - antena[j]) > k:
            frag = False
print('Yay!' if frag else ':(')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, os


if 'local' in os.environ :
    sys.stdin = open("./input.txt", "r")

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import sys


def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    if e - a <= k:
        print("Yay!")
    else:
        print(":(")
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    e = int(next(tokens))  # type: int
    k = int(next(tokens))  # type: int
    solve(a, b, c, d, e, k)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

lenge = 0

for i in range(5):
  for j in range(5):
    if A[i] - A[j] > K:
      lenge += 1
      
if lenge > 0:
  print(":(")
else :
  print("Yay!")

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if((b-a > k) or (c-b > k) or (d-c > k) or (e-d > k) or (c-a > k) or (d-a > k) or (e-a > k) or (d-b > k) or (e-b > k) or (e-c > k)):
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Apr  8 14:51:17 2019

@author: adachi-lab
"""

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

for q in range(4):
    y.append(input_code[-1]-input_code[q])
    
for w in range(3):
    y.append(input_code[-2]-input_code[w])
    
for j in range(2):
    y.append(input_code[-3]-input_code[j])
    
y.append(input_code[1]-input_code[0])


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

Submission status: Accepted

Solution code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
# N = int(input())
a = [int(input()) for _ in range(5)]
k = int(input())
for e0 in a:
    for e1 in a:
        if abs(e0 - e1) > k:
            print(":(")
            exit()
print("Yay!")
# S = str(input())
# L = len(S)
# T = str(input())
# exit()

Submission status: Accepted

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

antenna = []

for _ in range(5):
    antenna.append(int(input()))

k = int(input())

ans = 'Yay!'

for j in range(4):
    for l in range(j+1, 5):
        if abs(antenna[j] - antenna[l]) > k:
            ans = ':('

print(ans)

Submission status: Accepted

Solution code:
import itertools as itr

antenna = []

s = 0

for _ in range(5) : 
    antenna.append(int(input()))
    
k = int(input())

l = list(itr.combinations(antenna, 2))

for i in l : 
    if (abs(i[0] -i[1])) > k :
        s = 1

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
list = [a,b,c,d,e]
for i in range(4):
    for j in range(4-i):
        if list[j+1]-list[i] <k+1:
            continue
        else:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
face='Yay!'
dlist=[e-d,e-c,e-b,e-a,d-c,d-b,d-a,c-b,c-a,b-a]
for i in range(0,10):
  if dlist[i]>k:
    face=':('
    break
  else:
    pass
print(face)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Antennas=list()

for i in range(5):
    Antennas.append(input())

k = int(input())
#print(Antennas)

result = int(Antennas[4]) - int(Antennas[0])

if result > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

maxDist = e-a 

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
antennas = []
for _ in range(5):
  a = int(input())
  antennas.append(a)
k = int(input())
cannot_communicate_pair_exists = False
for i in range(len(antennas)):
  for q in range(len(antennas)):
    if i == q:
      continue
    if abs(antennas[i]-antennas[q]) > k:
      cannot_communicate_pair_exists = True
      break
  if cannot_communicate_pair_exists:
    break
if cannot_communicate_pair_exists:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
#abc123a

l=[]
for i in xrange(6):
 l.append(int(raw_input()))
k=l[-1]
if l[4]-l[0]>k:
 print ':('
else:
 print 'Yay!'

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
K = int(input())
if E-A>K:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
fl = True
s = [a,b,c,d,e]
for i in range(len(s)):
    for j in range(len(s)):
        if j <= i:
            continue
        if s[j]-s[i] > k:
            fl = False
if fl:
    print("Yay!")
else :
    print(":(")

Submission status: Accepted

Solution code:
a = int(input())
d = int(input())
f = int(input())
h = int(input())
e = int(input())
k = int(input())

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

Submission status: Accepted

Solution code:
from sys import exit

distance = [int(input()), int(input()), int(input()), int(input()), int(input())]

k = int(input())

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

Submission status: Accepted

Solution code:
a = int(input())
_ = int(input())
_ = int(input())
_ = int(input())
e = int(input())
k = int(input())

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

Submission status: Accepted

Solution code:
a, b, c, d, e, k = [int(raw_input()) for i in range(6)]
#print(k)

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

flag = True

for i in range(5):
    y = list[0]
    list.pop(0)
    #print(list)
    alist = map(lambda x: x - y, list)
    #print(alist)
    if (all([z <= k for z in alist])) == False:
        flag = False
        break
    else:
        continue
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = [int(input()) for i in range(6)]
i = 0
j = 0
flag = 0
while i <= 5 and flag == 0:
    while j <= 5:
        if x[i]-x[j] > x[5]:
            print(":(")
            flag = 1
            break
        j += 1
    i += 1
    j = 0

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

Submission status: Accepted

Solution code:
a=[0]*5
for i in range(5):
    a[i]=int(input().strip())
k=int(input().strip())
d=max(a)-min(a)
if d<=k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import sys


def solve(l,k):
  for i in range(5):
    for j in range(5):
      if abs(l[i]-l[j] > k):
        return False
  return True


l = []
for _ in range(5):
  l.append(int(input()))
k = int(input())
if solve(l,k):
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(5):
  for j in range(4-i):
    if list[i+1+j] - list[i] > k:
      print(":(")
      break
  else:
    print("Yay!")
  break