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 sys
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())
for i in range(5):
  for j in range(i+1,5):
    if a[j]-a[i]>k :
      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())
if e-a<=k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

antena.sort()
k = int(input())

if antena[-1] - antena[0] <= 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(':(')
else:
  print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
min_x = 123
max_x = 0

for _ in range(5):
    x = int(input())
    if x <= min_x:
        min_x = x
    if x >= max_x:
        max_x = x

k = int(input())
if k < max_x-min_x:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
n=[int(input()) for _ in range(6)];print([':(','Yay!'][n[4]-n[0]<=n[5]])

Submission status: Accepted

Solution code:
n=[int(input()) for _ in range(6)];print([':(','Yay!'][max(n[:5])-min(n[:5])<=n[5]])

Submission status: Accepted

Solution code:
antennas = [
    int(input()),
    int(input()),
    int(input()),
    int(input()),
    int(input())
]
k = int(input())

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

Submission status: Accepted

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

print(":(") if e - a > k 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:
nums = [int(input()) for _ in range(5)]
k = int(input())

if nums[-1]-nums[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:
I=[]
for i in range(5):
    I.append(int(input()))
k=int(input())
if I[4]-I[0]<=k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

Solution code:
from itertools import combinations

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

for i, j in combinations(coord, 2):
    if j - i > k:
        print(':(')
        break
else:
    print('Yay!')

Submission status: Accepted

Solution code:
L=[int(input()) for _ in range(6)];print(["Yay!",":("][L[4]-L[0]>L[5]])

Submission status: Accepted

Solution code:
L=[int(input()) for _ in range(6)];print(["Yay!",":("][L[4]-L[0]>L[5]])

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:
ans=0
a=[0]*5
for x in range(5):
  a[x]=int(input())
k=int(input())
for y in range(5):
  for z in range(5):
    if y!=z:
      if abs(a[y]-a[z])>k:
        ans+=1
if ans==0:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
from itertools import combinations

A = [int(input()) for _ in range(5)]
k = int(input())
for a in combinations(A, 2):
    p, q = a
    if abs(p - q) > k:
        print(":(")
        exit()
print("Yay!")

Submission status: Accepted

Solution code:
# abc123_a.py
# https://atcoder.jp/contests/abc123/tasks/abc123_a

# ★ WA:2
# in2.txt
# in3.txt

# A - Five Antennas /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 100点

# 問題文
# AtCoder 市には、5つのアンテナが一直線上に並んでいます。
# これらは、西から順にアンテナ A,B,C,D,E と名付けられており、それぞれの座標は a,b,c,d,e です。
# 2 つのアンテナ間の距離が k 以下であれば直接通信ができ、k より大きいと直接通信ができません。
# さて、直接 通信ができないアンテナの組が存在するかどうか判定してください。
# ただし、座標 p と座標 q (p<q) のアンテナ間の距離は q−pであるとします。

# 制約
#     a,b,c,d,e,kは 0 以上 123以下の整数
#     a<b<c<d<e

# 入力
# 入力は以下の形式で標準入力から与えられる。
# a
# b
# c
# d
# e
# k


# 出力
# 直接 通信ができないアンテナの組が存在する場合は :(、存在しない場合は Yay! と出力せよ。

# 入力例 1
# 1
# 2
# 4
# 8
# 9
# 15

# 出力例 1
# Yay!

# この場合、直接通信できないアンテナの組は存在しません。なぜなら、
#     (A,B)の距離は 2−1 = 1
#     (A,C)の距離は 4−1 = 3
#     (A,D)の距離は 8−1 = 7
#     (A,E)の距離は 9−1 = 8
#     (B,C)の距離は 4−2 = 2
#     (B,D)の距離は 8−2 = 6
#     (B,E)の距離は 9−2 = 7
#     (C,D)の距離は 8−4 = 4
#     (C,E)の距離は 9−4 = 5
#     (D,E)の距離は 9−8 = 1

# そのように、全てのアンテナ間の距離が 15以下であるからです。
# よって、Yay! と出力すれば正解となります。

# 入力例 2
# 15
# 18
# 26
# 35
# 36
# 18

# 出力例 2
# :(

# この場合、アンテナ A
# と D の距離が 35−15 = 20 となり、18 を超えるため直接通信ができません。
# よって、:( と出力すれば正解となります。 


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # line = lines[0]
    # N = int(lines[0])
    # N, Q = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[1].split()))
    values = list()
    for i in range(5):
        values.append(int(lines[i]))
    # valueses = list()
    # for i in range(Q):
    #     valueses.append(list(map(int, lines[i+1].split())))

    log(f'lines[5]=[{lines[5]}]')

    for i in range(5):
        for j in range(5):
            log(f'values[i]=[{values[i]}], values[j]=[{values[j]}], lines[5]=[{lines[5]}]')
            log(f'abs(values[i] - values[j])=[{abs(values[i] - values[j])}], int(lines[5])=[{int(lines[5])}]')
            if abs(values[i] - values[j]) > int(lines[5]):
                return [':(']
    return ['Yay!']


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['1', '2', '4', '8', '9', '15']
        lines_export = ['Yay!']
    if pattern == 2:
        lines_input = ['15', '18', '26', '35', '36', '18']
        lines_export = [':(']
    if pattern == -1:
        lines_input = ['18', '19', '26', '35', '36', '18']
        lines_export = ['Yay!']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(6)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    if FLAG_LOG:
        log(f'lines_input=[{lines_input}]')
        log(f'lines_export=[{lines_export}]')
        log(f'lines_result=[{lines_result}]')
        if lines_result == lines_export:
            log('OK')
        else:
            log('NG')
    finished = time.time()
    duration = finished - started
    log(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

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:
arr = [int(input()) for _ in range(5)]
k = int(input())
if max(arr)-min(arr)<=k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:

import sys
def I(): return int(sys.stdin.readline().rstrip())

A = [I() for i in range(6)]
if A[4]-A[0] > A[-1]:
    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())
import itertools

cannot=False
for x,y in itertools.combinations([a,b,c,d,e],2):
    if y-x>k:
        cannot=True
if cannot:
    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:
l=[]
for _ in range(5):
    l.append(int(input()))
k = int(input())
print('Yay!' if l[-1] - l[0]<=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:
lst = []
for i in range(5):
    lst.append(int(input()))
k = int(input())    
lst.sort()
print(":(" if lst[-1] - lst[0] > k else "Yay!")

Submission status: Accepted

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

for i in a[1:-1]:
    if i-a[0] > a[-1]:
        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())
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())

print(':(' if e - a > k else '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 = []
l.append(b-a)
l.append(c-a)
l.append(d-a)
l.append(e-a)
l.append(c-b)
l.append(d-b)
l.append(e-b)
l.append(d-c)
l.append(e-c)
l.append(e-d)

if max(l) <= 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:
IN = [int(input()) for i in range(6)]
if IN[4] - IN[0] <= IN[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 k >= e-a:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = 1
for i in range(len(x)-1):
  for j in range(len(x)):
    if x[j]-x[i] > k:
      flag = 0
      break
  if flag == 0:
    break
if flag == 0:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = []
ans = 'Yay!'
for i in range(6):
    n.append(int(input()))
for i in range(5):
    for j in range(5):
        if abs(n[i] - n[j]) > n[5]:
            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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
import sys
array = [0,0,0,0,0,0]
for I in range(len(array)):
    array[I] = int(input())
    if not ( 0 <= array[I] <= 123 ):
        sys.exit()
print('Yay!') if (array[4] - array[0]) <= array[-1] else print(':(')

Submission status: Accepted

Solution code:
def main():
 a = int(input())
 b = int(input())
 c = int(input())
 d = int(input())
 e = int(input())
 lim = int(input())
 if max(a,b,c,d,e) - min(a,b,c,d,e) <= lim:
     print('Yay!')
 else:
     print(':(')
main()

Submission status: Accepted

Solution code:
A=[0]*6
for i in range(6):
  A[i]=int(input())
  
isOK=True
for i in range(5):
  for j in range(i,5):
    if(abs(A[i]-A[j]) > A[5]):
      isOK=False
      
if(isOK):
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

def main():
    antennas = [int(input()) for _ in range(5)]
    k = int(input())
    for i in range(4):
        for j in range(i+1, 5):
            if antennas[j] - antennas[i] > k:
                print(":(")
                return
    print("Yay!")
        
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d,e,k=[int(input()) for i in range(6)]
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:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

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

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


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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

n=int(input())

if a[4]-a[0]>n:
  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=0
for i in [a,b,c,d,e]:
  for j in [a,b,c,d,e]:
    if abs(i-j)>k:
      f=f+1
      
if f>0:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

abc=[list(map(int,input().split())) for i in range(6)]
if abc[4][0]-abc[0][0]>abc[5][0]:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(5)]
k = int(input())
ans = False
for j in range(5):
  for f in range(j+1, 5):
    if a[f] - a[j] > k:
      ans = True
if ans:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

A = sorted([ii() for _ in range(5)])

K = ii()

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

Submission status: Accepted

Solution code:
V = []
for i in range(5):
  V.append(int(input()))
               
k = int(input())
               
d = max(V) - min(V)

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

Submission status: Accepted

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

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:
import sys
sys.setrecursionlimit(10**6)

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

for i in a2e:
    for j in a2e:
        if abs(i-j) > k:
            print(':(')
            break
    else:
        continue
    break
else:
    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:
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()) for _ in range(5)]
K = int(input())

ans = "Yay!"
for i in range(5):
    for j in range(5):
        if A[i] - A[j] > K:
            ans = ":("

print(ans)

Submission status: Accepted

Solution code:
import sys
ri = lambda: int(sys.stdin.readline())
li = [ri() for _ in range(6)]
print(':(' if li[4] - li[0] > li[5] else 'Yay!')

Submission status: Accepted

Solution code:
import sys
ri = lambda: int(sys.stdin.readline())
li = [ri() for _ in range(6)]
print(':(' if li[4] - li[0] > li[5] else 'Yay!')

Submission status: Accepted

Solution code:
import sys
rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = [ri() for _ in range(6)]
print(':(' if li[4] - li[0] > li[5] else 'Yay!')

Submission status: Accepted

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

k = int(input())

ans = 0
for i in range(5):
  for j in range(5):
    if (x[i] - x[j]) > k:
      print(':(')
      exit(0)

print('Yay!')

Submission status: Accepted

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

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

if max(L) - min(L) <= 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(':(')
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())

S=a,b,c,d,e

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

Submission status: Accepted

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

if l[4]-l[0]>l[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())
s = list(sorted([a, b, c, d, e]))
d_min = s[0]
d_max = s[-1]
if d_max - d_min > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

k = int(input())

max_dist = max(antena)
min_dist = min(antena)

l = max_dist - min_dist

if l <= 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:
n=[int(input()) for i in range(6)]
x=n[5]+1
flg=0
if n[1]-n[0] < x and n[2]-n[0] < x and n[3]-n[0] < x and n[4]-n[0] < x:
    if n[2]-n[1] < x and n[3]-n[1] < x and n[4] - n[1] < x:
        if n[3]-n[2] < x and n[4]-n[2] < x:
            if n[4]-n[3] < x:
                flg=1
print(':(' if flg==0 else 'Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
import sys
input = sys.stdin.readline
a =[]
for i in range(5):
    x = int(input())
    a.append(x)
k = int(input())

#ソートして最大と最小を比較
if a[-1] -a[0] >k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
import itertools
*l, k = [int(input()) for _ in range(6)]

c = itertools.combinations(l, 2)

for x, y in c:
    if abs(x-y) > 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 b-a<=k and c-b<=k and d-c<=k and e-d<=k and c-a<=k and d-a<=k and e-a<=k and d-b<=k and e-b<=k and e-c<=k:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(l)):
    for j in range(i+1, len(l)):
        if l[j] - l[i] > k:
            p = False
            break          
if p :
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

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

count = 0
for p in itertools.permutations(antenna, 2):
    x, y = p
    if abs(x - y) > k:
        count += 1

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

Submission status: Accepted

Solution code:
*ant, k = [int(input()) for _ in range(6)]
print(':(' if ant[-1] - ant[0] > k else 'Yay!')

Submission status: Accepted

Solution code:
l = []
for i in range(5):
    l.append(int(input()))
k = int(input())
ok = True
for i in range(5):
    for j in range(5):
        if i == j: continue
        diff = abs(l[i] - l[j])
        if diff > k:
            ok = False
if ok: print('Yay!')
else: print(':(')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

p = [INT() for i in range(5)]
k = INT()

p.sort()
flg = False

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
*l,k=map(int,open(0).read().split())
from itertools import permutations 
perm = permutations(l, 2) 
ans=[]
for i in list(perm): 
  ans.append(i[1]-i[0])
print("Yay!" if max(ans)<= 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 abs(a - e) > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

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())
L=[a,b,c,d,e]
for i in range(4):
  for j in range(i+1,5):
    if abs(L[i]-L[j])>k:
      print(":(")
      sys.exit()
print("Yay!")

Submission status: Accepted

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

print(':(' if A[4]-A[0] > K else 'Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

    nums = []
    nums.extend([a, b, c, d, e])
    nums.reverse()

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

main()

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:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
K=int(input())
a=(E-A)
if K>=a:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    li=[int(readline()) for _ in range(5)]
    k=int(readline())

    for i in range(1,5):
        if k<li[i]-li[0]:
            print(":(")
            break
    else:
        print("Yay!")
        
if __name__=="__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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