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:
L={}
for i in range(5):
    L[i]=int(input())
k=int(input())


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
b=int(input())
b=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 = []
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:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    v = []
    for _ in range(5):
        v.append(int(input()))
    k = int(input())
    v.sort()

    if abs(v[0] - v[-1]) > k:
        print(":(")
    else:
        print("Yay!")




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    a = [int(input()) for i in range(5)]
    k = int(input())
    ans = False
    for aa in a:
        for b in a:
            if abs(aa-b) > k:
                ans = True
                break
        if ans:
            break
    print(':(' if ans else 'Yay!')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = [int(input()) for i in range(6)]
ans = 0
for i in A:
    ans += len(list(filter(lambda x: (i - x) > A[-1], A)))
print('Yay!' if ans == 0 else ':(')

Submission status: Accepted

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

for i in antenna:
    antenna_out = list(filter(lambda j: (i - j) > k, antenna))
    if len(antenna_out) != 0:
        print(":(")
        break
else:
    print("Yay!")

Submission status: Accepted

Solution code:
antena = [0, 0, 0, 0, 0, 0]
ng_count = 0

for i in range(0, 6):
    antena[i] = int(input()) #antena[5]は距離"k"として扱う

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
L = []
for i in range(5):
  x = int(input())
  L.append(x)
K = int(input())
if L[4] - L[0] <= K:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
coo_dis = [int(input()) for i in range(6)]
a = coo_dis[0]
b = coo_dis[1]
c = coo_dis[2]
d = coo_dis[3]
e = coo_dis[4]
k = coo_dis[5]
if (b - a) and (c - a) and (d - a) and (e - a) <= k:
    if (c - b) and (d - b) and (e - b) <= k:
        if (d - c) and (e - c) <= k:
            if (e - c) <= k:
                print("Yay!")
            else:
                print(":(")
        else:
            print(":(")
    else:
        print(":(")
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())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

dai = max([a,b,c,d,e])
shou = min([a,b,c,d,e])

if (dai - shou) <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
inputstr1 = [input() for inputstr1 in range(6)]

a = int(inputstr1[0])
b = int(inputstr1[1])
c = int(inputstr1[2])
d = int(inputstr1[3])
e = int(inputstr1[4])
k = int(inputstr1[5])

inputmax = max(a, b, c, d, e)
inputmin = min(a, b, c, d, e)


if inputmax - inputmin <= 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())
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:
s = int(input())
for _ in range(3):
    input()
g = int(input())
k = int(input())

if k < g - s:
    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())
f=max([a,b,c,d,e])
g=min([a,b,c,d,e])
z= f-g
if (z>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())
max=a
min=a
if (max<b):
    max=b
if (max<c):
    max=c
if (max<d):
    max=d
if (max<e):
    max=e
if (min>b):
    min=b
if (min>c):
    min=c
if (min>d):
    min=d
if (min>e):
    min=e
z= max-min
if (z>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]
for i in range(1,5):
    for j in range(0,i):
        if ant[i] - ant[j] > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

a = int(a)
e = int(e)
k = int(k)

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    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(":(")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def II(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def SI(): return input()
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')

li = []
for i in range(5):
    li.append(II())
k = II()

if li[-1] - li[0] > k:
    print(':(')
    sys.exit()

print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
a, b, c, d, e, k = map(int,sys.stdin.readlines())
if e - a > k:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

bad_flag = False
for i,ant in enumerate(antena):
	for bnt in antena[i:] :
		if abs(ant - bnt) > k :
			bad_flag = True 
	if bad_flag :
		break

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

Submission status: Accepted

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


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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
da=[int(input()) for i in range(6)]
if da[4]-da[0]<=da[5]:
  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:
lis = [0,0,0,0,0,0]
for i in range(6):
    lis[i] = int(input())
if lis[4]-lis[0]>lis[5]:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = []
for i in range(5):
  str = input()
  A.append(int(str))
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=list(map(int, [input() for i in range(6)]))
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(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
IN = [int(input()) for _ in range(6)]

if IN[4] - IN[0] > IN[5]:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
L = []

for i in range(5):
   L.append(int(input()))
k = int(input())
L.sort()

if L[-1] - L[0] > k:
  print(":(")

else:
  print("Yay!")

Submission status: Accepted

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

k=int(input())

for i in range(len(x) - 1):
    for j in range(i + 1, len(x)):
        if x[j] - x[i] > k:
            print(':(')
            quit()
    
print('Yay!')

Submission status: Accepted

Solution code:
def sub():
    items = [int(input()) for _ in range(6)]
    aa = items[:5]
    k = items[5]
    d = aa[-1] - aa[0]
    if d > k:
        print(":(")
    else:
        print("Yay!")

sub()

Submission status: Accepted

Solution code:
antenas = [int(input()),int(input()),int(input()),int(input()),int(input())]
k = int(input())
flg = False

for i in antenas:
    for j in antenas:
        flg = abs(j - i) > k
        if flg:
            break

if flg:
    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:
a,*_,e,k=[int(input())for x in' '*6];print(['Yay!',':('][e-a>k])

Submission status: Accepted

Solution code:
a,*_,e,k=[int(input())for x in' '*6];print([':(','Yay!'][e-a<=k])

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:
l = []
for x in range(5):
    l.append(int(input()))
k = int(input())

cnt = 0
for i in range(5):
    for j in range(5):
        diff = abs(l[i] - l[j])
        if diff > k:
            cnt += 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Coding: Utf-8
count=0
a=[]
for i in range(5):
    a.append(input())
K=int(input())
a.sort(reverse=True)

for j in range(5):
    for k in range(5):
        if int(a[j])-int(a[k])>K:
            count+=1


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

Submission status: Accepted

Solution code:
# coding:UTF-8

antennas = list()

# A〜Eの座標を取り込む　
for _ in range(5):
    antennas.append(int(input()))

distance_range = int(input())

result = 'Yay!'

for i in range(len(antennas) - 1):
    for j in range(1, len(antennas)):
        if distance_range < antennas[j] - antennas[i]:
            result = ':('
            break

print(result)

Submission status: Accepted

Solution code:
from sys import stdin
from itertools import combinations


def solve(nums):
    *positions, k = nums
    fst, last = positions[0], positions[-1]
    return abs(fst - last) <= k


def main():
    nums = [int(l) for l in stdin.readlines()]
    ans = solve(nums)
    print('Yay!' if ans else ':(')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

k = int(input())

ans = []
for i in range(5):
    for j in range(5):
        ans.append(abs(l[i] - l[j])>k) 

print(['Yay!',':('][any(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 abs(a-e) > 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())
input = [a,b,c,d,e]
answer = "Yay!"

for count1 in range(0,5):
    for count2 in range(0,5):
        stock = input[count2] - input[count1]
        if stock > k:
            answer = ":("
            break
print(answer)

Submission status: Accepted

Solution code:
antennas = []

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

k = int(input())

if max(antennas) - min(antennas) > 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('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 (
  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(":(")

Submission status: Accepted

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


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


# Generated by 1.1.4 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:
anths = []
for i in range(5):
    anths.append(int(input()))
k = int(input())
from itertools import combinations

for a, b in combinations(anths, 2):
    if abs(a-b) > k:
        print(":(")
        exit()

print('Yay!')

Submission status: Accepted

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

antenna = [int(input()) for i in range(0,5)]
k=int(input())

distance = [[0,0,0,0,0] for i in range(len(antenna)) ]

flag = 0
for jj in range(len(antenna)):
    for kk in range(len(antenna)):
        distance[jj][kk]=abs(antenna[jj]-antenna[kk])
        if distance[jj][kk] > k:
            flag = 1

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

Submission status: Accepted

Solution code:
list = []
for i in range(6):
    list.append(int(input()))
if list[4] - list[0] > list[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(":(");
else:
   print("Yay!");

Submission status: Accepted

Solution code:
l = []

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

k = int(input())

if max(l) - min(l) > 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('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 and a < b < c < d < e:
  print('Yay!')
  
else:
  print(':(')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a = [int(l) for l in sys.stdin]    
k = a[-1]
a = sorted(a[:-1])

is_far = False
for x in reversed(a):
  if (x - a[0]) > k:
    is_far = True
    break

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


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:
'''input
1
2
4
8
9
15
'''

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

for i in range(5):
	for j in range(5-i):
		if abs(a[i+j]-a[i])>k:
			print(':(')
			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())
if e - 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('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=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 = 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 = 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=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 =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 = 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 = 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 = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A - Five Antennas
https://atcoder.jp/contests/abc123/tasks/abc123_a

"""
import sys


from itertools import combinations

def solve(antennas, k):
    for a, b in combinations(antennas, 2):
        if abs(a-b) > k:
            return ':('
    return 'Yay!'


def main(args):
    antennas = [int(input()) for _ in range(5)]
    k = int(input())
    ans= solve(antennas, k)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = []; t = True
for i in range(5):
  l.append(int(input()))
k = int(input())
for i in range(5):
  for j in range(i+1,5):
    if abs(l[j] - l[i]) > k:
      t = False
      break
if t:
  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 (max(a,b,c,d,e) - min(a,b,c,d,e)) > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

if (l[4] - 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())

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

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

Submission status: Accepted

Solution code:
antenna = []
antenna.append(int(input()))
antenna.append(int(input()))
antenna.append(int(input()))
antenna.append(int(input()))
antenna.append(int(input()))
k = int(input())

flg = 'Yay!'
for i in range(0, len(antenna)):
  for j in range(i+1, len(antenna)):
    if (antenna[j]-antenna[i])>k:
      flg = ':('
      break
print(flg)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
ans = 0
for i in [a, b, c, d, e]:
    for j in [a, b, c, d, e]:
        if i != j and k < j - i:
            ans = 1

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

Submission status: Accepted

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

if list1[4] - list1[0] > int(input()):
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    a, b, c, d, e, k = [int(stdin.readline()) for _ in range(6)]
    print('Yay!' if (e - a) <= k else ':(')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = [int(input()) for i in range(6)]
print('Yay!' if (n[4]-n[0]) <= n[5] 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(":(")
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())
i = [a,b,c,d,e]
x = 0
for num1 in range(5):
	for num2 in range(5):
		if num2 > num1:
			ans = i[num2] - i[num1]
			if ans > k:
				x += 1

if x == 0:
	print("Yay!")
elif x != 0:
	print(":(")

Submission status: Accepted

Solution code:
import sys
data = []
for i in range(5):
    data.append(int(input()))
k = int(input())
data.sort()
for i in range(5):
    for j in data[i+1:]:
        if j - data[i] > k:
            print(':(')
            sys.exit()
        else:
            continue
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(5)]
if l[4]-l[0] <= int(input()):
    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:
import sys
a = int(input())
input()
input()
input()
e = int(input())
k = int(input())
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())

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

Submission status: Accepted

Solution code:
a = int(input())
for i in range(3):
	x = 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(input())

b = 0
for i in range(5):
    if b == 1:
        break
    for j in range(4-i):
        ans = abs(int(a[i]) - int(a[j+1]))
        if ans > int(a[5]):
            print(':(')
            b = 1
            break
        
    if i == 4 and b == 0:
        print('Yay!')

Submission status: Accepted

Solution code:
import sys
import subprocess
import re
import datetime
import os

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

A = [a,b,c,d,e]
S = sorted(A)



V = (S[4] - S[0])
if V <= 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())

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

for i in range(0, 5):
    if abs(nums[i] - nums[i-1]) > k:
        print(':(')
        exit()
print('Yay!')

Submission status: Accepted

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

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

def hoge(t_list, k):
  for i in range(5):
    for j in range(5):
      if abs(t_list[i] - t_list[j]) > k :
        return(":(")
  return("Yay!")

print(hoge(t_list, k))

Submission status: Accepted

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

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

Submission status: Accepted

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

def main(X, k):
    flag = True
    for i in range(5):
        for j in range(5):
            if(abs(X[i]-X[j]>k)):
                flag = False
                break
    print("Yay!" if flag else ":(")
    

if __name__ == '__main__':
    X = []
    for i in range(5):
        X.append(int(input()))
    k = int(input())
    
    main(X, k)

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