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:
import itertools 
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
X=[a,b,c,d,e]
S=list(itertools.combinations(X,2))
ans='Yay!'
for i in range(len(S)):
    if abs(S[i][0]-S[i][1])>k:
        ans=':('
print(ans)

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(5)]
k = int(input())
l = a[4] - a[0]
if 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-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:
l=[int(input()) for i in range(6)]
def C():
    for i in range(5):
        for j in range(i, 5):
            if l[j]-l[i]>l[5]:
                return False
    return True
if C():
    print('Yay!')
else:
    print( ':(')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
l = []

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

l.sort()

th = int(input())

if th < (l[4] - l[0]):
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(5)]
k = int(input())
ans = True
for i in range(5):
    try:
        if a[i+1] - a[0] > k:
            ans = False
            break
    except:
        pass
if ans:
    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())

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

Submission status: Accepted

Solution code:
all_list = []

for i in range(6):
  a = int(input())
  if i < 5:
    all_list.append(a)
  else:
    k = a

M = max(all_list)
m = min(all_list)

if M - m <= k:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
l = [int(input()) for _ in range(6)]
k = l.pop(-1)
for i in range(1,len(l)):
    if abs(l[0] - l[i]) > k:
        print(':(')
        exit()
print("Yay!")

Submission status: Accepted

Solution code:
#n=int(input())
#li=input().split()
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
#import math
#li=list(map(int,input().split()))
#S=input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
 
arg = [int(input()) for i in range(6)] 
if arg[4] - arg[0] > arg[5]:
    print (":(")
else:
    print ("Yay!")

Submission status: Accepted

Solution code:
#coding: utf-8
l = []
for i in range(5):
    a = int(input())
    l.append(a)
k = int(input())
cnt = 0
for i in range(len(l)):
    for j in range(i+1, len(l)):
        if abs(l[i] - l[j]) > k:
            cnt += 1
print("Yay!" if cnt == 0 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 max(a,b,c,d,e)-min(a,b,c,d,e)<=k:
    print("Yay!")
else: 
    print(":(")

Submission status: Accepted

Solution code:
l=[int(input()) for i in range(5)]
k=int(input())
A=True
for i in range(4):
  for j in range(i+1,5):
    a=l[j]-l[i]
    if a>k:
      A=False
      break
if A:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
a = []
for i in range(5):
    a.append(int(input()))
k = int(input())
if max(a) - min(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())

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

if  M-m>k:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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


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

antenna = [a, b, c, d, e]
is_ok = True
for i in range(len(antenna)):
    for j in range(i+1, len(antenna)):
        if antenna[j] - antenna[i] > k:
            is_ok = False

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8-*-
if __name__ == '__main__':
    a = []
    for _ in range(5):
        a.append(int(input()))
    k = int(input())
    for i in range(5):
        for j in range(i+1, 5):
            if abs(a[i] - a[j]) > k:
                print(":(")
                exit()
    print("Yay!")

Submission status: Accepted

Solution code:
a=[]
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
a.append(int(input()))
k=int(input())
a=sorted(a)
if k >= a[4]-a[0]:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

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

k = A[5] 
judge = 1
for i in range(5):
  for j in range(5):
    if(abs(A[i]-A[j]) > k):
      judge = 0
      break
   
if(judge == 0):
  print(':(')
else:
  print('Yay!')

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:
# coding: utf-8

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a = int(input())
    for i in range(3):
        _ = int(input())
    e = int(input())
    k = int(input())
    if e - a > k:
        print(':(')
    else:
        print('Yay!')


main()

Submission status: Accepted

Solution code:
inputs = []
for i in range(6):
    tmp = int(input())
    inputs.append(tmp)
    
for i in inputs[:-1]:
    for j in inputs[:-1]:
        d = abs(i - j)
        if d > inputs[-1]:
            print(':(')
            exit()

print('Yay!')

Submission status: Accepted

Solution code:
A=[]
for i in range(5):
    A.append(int(input()))
k=int(input())
dis=max(A)-min(A)
if dis<=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())
lis = [a, b, c, d, e]
for i in lis:
    for j in lis:
        if i - j > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

Solution code:
A = [int(input()) for _ in range(5)]
k = int(input())
flag = True
for left in range(4):
    for right in range(left + 1, 5):
        if A[right] - A[left] > k:
            flag = False
if flag:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

# input = sys.stdin.readline

# N個整数
# a, b, c = list(map(int, input().split()))

# 1整数
# n = int(input())

# 空白区切りリスト整数
# b = list(map(int, input().split()))

# 空白区切り文字列
# t, d = input().split()
ll = []

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:52:46 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy
import bisect

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

"""

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(6)]
print("Yay!") if abs(a[4] - a[0]) <= a[5] else print(":(")

Submission status: Accepted

Solution code:
s = [int(input()) for i in range(5)]
k = int(input())
c = 0 
for i in range(5):
    for j in range(i+1,5):
        t = s[j] -s[i]
        if t > k:
            c = 1
        else:
            continue

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'Yay!'
if (ant[-1] - ant[0] > k):
    ans = ':('

print(ans)

Submission status: Accepted

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

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

ok = True
for s,t in itertools.combinations(l,2):
	if abs(s-t) > k:
		ok = False

if ok:
	print('Yay!')
else:
	print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=int(input())
input()
input()
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())
if b-a > k or c-a > k or d-a > k or e-a>k or c-b > k or d-b> k or e-b>k or d-c > k or e-c>k or e-d > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ant_list = [int(input()) for _ in range(5)]
k = int(input())
flg = True
for t in ant_list:
    for j in ant_list:
        if abs(t-j)>k:
            flg = False

if flg:
    print("Yay!")

else:
    print(":(")

Submission status: Accepted

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

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())
b = input()
c = input()
d = input()
e = int(input())
k = int(input())
if e - a > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
import sys

stdout = sys.stdout
rr = lambda: input().strip()
rri = lambda: int(rr())
rrm = lambda: list(map(int, rr().split()))

a = rri()
b = rri()
c = rri()
d = rri()
e = rri()
k = rri()

lst = [a,b,c,d,e]
while True:
    for i, ant in enumerate(lst[:4]):
        for j, ant2 in enumerate(lst[i:]):
            if ant2 - ant > k:
                print(':(')
                quit()

    print('Yay!')
    quit()

Submission status: Accepted

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

dfs = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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=[]
for i in range(5):
 a.append(int(input()))
k = int(input())
if (max(a)-min(a))<=k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

flag=1
for i in range(5):
    for j in range(5):
        if abs(distance[i]-distance[j])>k:
            flag=0
if flag:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
antena = [int(input()) for i in range(5)]
k = int(input())
ans = 1
for i in antena:
    for j in antena:
        if i != j and abs(i - j) > k:
            ans = -1
            break
    if ans == -1:
        break

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

Submission status: Accepted

Solution code:
def five_antennas(a: int, b: int, c: int, d: int, e: int, k: int)->bool:
    antennas = [a, b, c, d, e]
    for i in range(5):
        for j in range(i+1, 5):
            if k < antennas[j] - antennas[i]:
                return False
    return True


if __name__ == "__main__":
    inputs = [int(input()) for _ in range(6)]
    a, b, c, d, e, k = inputs
    yes = five_antennas(a, b, c, d, e, k)
    print('Yay!' if yes 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:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if e-a<=k and e-b<=k and e-c<=k and e-d<=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:
d = []
d.append(int(input()))
d.append(int(input()))
d.append(int(input()))
d.append(int(input()))
d.append(int(input()))
k = int(input())

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

Submission status: Accepted

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

exists = False

for i in a:
    for j in a:
        if abs(i - j) > k:
            exists = True

if exists:
    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())
L = [a,b,c,d,e]
flag = True
for i in range(4):
  for j in range(i,5):
    if abs(L[i]-L[j]) > k:
      flag = False
      break
if flag:
  print('Yay!')
else:
  print(':(')

Submission status: Accepted

Solution code:
from itertools import combinations
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
for p, q in combinations([a, b, c, d, e], 2):
    if abs(p - q) > 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())
ans='Yay!'
if e-a>k:
    ans=':('
print(ans)

Submission status: Accepted

Solution code:
def solve(l, k):
    for i in range(len(l)):
        for j in range(i+1, len(l)):
            if l[j]-l[i] > k:
                return True
    return False


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

    l = [a,b,c,d,e]
    if solve(l, k):
        print(":(")
    else:
        print("Yay!")



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 asdf():
    if abs(a - b) > k: return False
    if abs(a - c) > k: return False
    if abs(a - d) > k: return False
    if abs(a - e) > k: return False
    if abs(b - c) > k: return False
    if abs(b - d) > k: return False
    if abs(b - e) > k: return False
    if abs(c - d) > k: return False
    if abs(c - e) > k: return False
    if abs(d - e) > k: return False
    return True

print("Yay!" if asdf() 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:
a=[int(input()) for i in range(5)]
k=int(input())
flag=1
for i in range(5):
    for j in range(i+1,5):
        if a[j]-a[i]>k:
            flag=0
            break
if flag:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# N,M = map(int, input().split())
a = [0] * 5
a[0] = int(input())
a[1] = int(input())
a[2] = int(input())
a[3] = int(input())
a[4] = int(input())
k = int(input())


ok = True
for i in range(4):
    if a[i+1] - a[i] > k :
        ok = False
        break
if  a[4] - a[0] > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = sorted(a)
if abs(a[4] - a[0]) > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
li = [int(input()) for i in range(6)]
if li[4] - li[0] <= li[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:
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()) #整数
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 = input()
b = input()
c = input()
d = input()
e = input()
k = input()

if int(e) - int(a) > int(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())
li = [a, b, c, d, e]
for i in range(5):
    for j in range(5):
        if i == j:
            continue
        if abs(li[j] - li[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())
li = [a, b, c, d, e]
if max(li) - min(li) <= k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
a, b, c, d, e, k = int(input()), int(input()), int(input()), int(input()), int(input()), int(input())
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())

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

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(5)]
k = int(input())
flag = 0
for i in range(5):
  for j in range(5):
    if abs(l[i]-l[j]) > k:
      flag = 1
      break
if flag == 1:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

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

a.sort()

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

Submission status: Accepted

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

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

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(":(")
	else:
		print("Yay!")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
an=[int(input()) for _ in range(5)]
k=int(input())
for i in range(5):
    for j in range(i+1, 5):
        if an[j] - an[i] > k:
            print(':(')
            break
    else:
        continue
    break
else:
    print('Yay!')

Submission status: Accepted

Solution code:
def main():
    a = []
    for i in range(5):
      n = int(input())
      a.append(n)
    k = int(input())
    a.sort()
    for i in a:
      for j in a:
        if i == j:
          continue
        if abs(i-j) > k:
          return False
    return True

if __name__ == '__main__':
    if main():
      print("Yay!")
    else:
      print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
ls = [int(input()) for i in range(5)]
k = int(input())
boo = False
for i in range(5):
    for j in range(5):
        if abs(ls[i] - ls[j]) > k:boo = True
if boo:print(':(')
else:print('Yay!')

Submission status: Accepted

Solution code:
import sys
from itertools import combinations

antena = [int(input()) for _ in range(5)]
k = int(input())
for a,b in combinations(antena, 2):
    if abs(a-b)>k:
        print(":(")
        break
else:
    print("Yay!")

Submission status: Accepted

Solution code:
antena = [int(input()) for i in range(5)]
k = int(input())
answer = "Yay!"
for i in range(5):
    now = antena[i]
    for j in range(i+1,5):
        sub = abs(now-antena[j])
        if sub > k:
            answer = ":("
    if answer != "Yay!":
        break
print(answer)

Submission status: Accepted

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

f = False
k  = int(input())
for a1 in an:
    for a2 in an:
        if abs(a1-a2) > k:
            f  =True
if f:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

for (i,j) in combinations([a,b,c,d,e], 2):
    if(abs(i-j)>k):
        print(":(")
        exit()

print("Yay!")

Submission status: Accepted

Solution code:
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g


an = []

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

k = int(input())

flag = False
if (an[-1]-an[0] > k):
        flag = True

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