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:
li=[int(input()) for i in range(5)]
k=int(input())
if li[1]-li[0]>k or li[2]-li[1]>k or li[3]-li[2]>k or li[4]-li[3]>k or li[4]-li[0]>k:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

cnt = 0
for i in range(5):
    for j in range(i + 1, 5):
        if abs(ds[i] - ds[j]) > k:
            cnt += 1
if cnt > 0:
    print(':(')
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())

CanYay = True
ant = [a,b,c,d,e]
for i in range(len(ant)):
    for j in range(i+1, len(ant)):
        if ant[i] == ant[j]:
            continue
        else:
            if abs(ant[i] - ant[j]) > k:
                CanYay = False
            else:
                continue
if CanYay:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC123 A
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
mylist = [a,b,c,d,e]
ans = 0
for i in range(0, len(mylist)-1):
    for j in range(1, len(mylist)):
        if ((mylist[j] - mylist[i]) > k):
            ans += 1
print(":(" if ans >0 else "Yay!")

Submission status: Accepted

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

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

Submission status: Accepted

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

k = int(input())
ans = "Yay!"
if abcde[4] - abcde[0] > k:
  ans = ":("
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = [int(input()) for i in range(6)]
hantei = False
for i in range(5):
    for j_ in range(1,5-i):
        j = i + j_
        if x[j]-x[i] > x[5] : 
            hantei = True
if hantei :
    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:
ae_list = [int(input()) for i in range(5)]
k = int(input())

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

print('Yay!')

Submission status: Accepted

Solution code:
A=[int(input()) for _ in range(5)]
k=int(input())
f=True
for i in range(4):
	for j in range(i,5):
		if abs(A[i]-A[j])>k:
			f=False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ant = [int(input()) for i in range(5)]
K = int(input())
for j in range(4):
  for k in range(4):
    if ant[4-j] - ant[3-k] > K:
      print(':(')
      exit()
print('Yay!')

Submission status: Accepted

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

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

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:
contena = []
for i in range(5):
	contena.append(int(input()))
thre = int(input())

distance = []
for c in contena:
	for j in contena:
		distance.append(abs(c-j))
if max(distance) > thre:
	print(':(')
else:
	print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

import copy

def main(): 

    a=[int(input()) for _ in range(6)]
    Flag = True
    for i in range(5):
        for j in range(5):
            if abs(a[i]-a[j]) > a[5]:
                Flag = False
                break
        if not(Flag):
            break
    if Flag:
        print("Yay!")
    else:
        print(":(")
    



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p = [int(input()) for _ in range(5)]
k = int(input())
for x in p:
    for y in p:
        if abs(x - y) > k:
            print(':(')
            exit()
print('Yay!')

Submission status: Accepted

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

k = int(input())
f = False
for a in l:
    for b in l:
        if a != b:
            if b - a > k:
                f = True

if f:
    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 = [int(input()) for i in range(6)]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
an=[int(input()) for i in range(5)]
k=int(input())
count=0
for j in range(5):
    for i in range(5):
        if j<i and an[i]-an[j]>k:
            count+=1
if count==0:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
from itertools import combinations

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

answer = "Yay!"
for x, y in combinations(antenna, 2):
    if abs(x - y) > k:
        answer = ":("
        break
print(answer)

Submission status: Accepted

Solution code:
Li = list(int(input()) for _ in range(6))
F =[1  for i in range(4) for j in range(i+1,5) if abs(Li[j]-Li[i]) <= Li[5]]
print ("Yay!" if len(F)==10 else ":(")

Submission status: Accepted

Solution code:
def distance():
    N = [input() for i in range(5)]
    N = list(map(int, N))
    dis = int(input())
    for i in range(5):
        for j in range(i + 1, 5):
            if N[j] - N[i] > dis:
                print(":(")
                return
    print("Yay!")


distance()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    p = []
    for _ in range(5):
        p.append(int(input()))
    k = int(input())
    if p[4] - p[0] > k:
        return ":("
    else:
        return "Yay!"

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s = [int(input()) for i in range(5)]
s.sort()
n = len(s)
k = int(input())
for i in range(n):
  for j in range(i+1,n):
    if s[j]-s[i] > k:
      print(":(")
      sys.exit()
print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
myArray = list()
for n in range(5):
   myArray.append(int(input()))
k = int(input())
myflag = True

for i in range(len(myArray)-1):
    for j in range(i+1,len(myArray)):
        if myArray[j] - myArray[i] > k:
            myflag = False

if myflag:
    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+a>=e:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

d = True
for i in range(5):
  if d:
    for j in range(i,5):
      if antenna[j]-antenna[i] > K:
        print(':(')
        d = False
        break
if d:
  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 a + k >= e:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

Solution code:
*ant, k = (int(input()) for _ in range(6))
flag = True
for i in range(5):
    for j in range(i+1,5):
        if ant[j] - ant[i] > k:
            print(":(")
            flag = False
            break
    if not(flag):
        break
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
A = [int(input()) for _ in range(5)]
k = int(input())
print([":(", "Yay!"][all([b-a <= k for a, b in itertools.combinations(A, 2)])])

Submission status: Accepted

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

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

Submission status: Accepted

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

if k >= antena[-1]-antena[0]:
    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-b) <= k and abs(a-c) <= k and abs(a-d) <= k and abs(a-e) <= k and abs(b-c) <= k and abs(b-d) <= k and abs(b-e) <= k and abs(c-d) <= k and abs(c-e) <= k and abs(d-e) <= k else ':( ')

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

x = [0]*5
for i in range(5):
    x[i] = I()
k = I()

ans = 'Yay!'
for i in range(5):
    for j in range(i+1,5):
        if abs(x[i]-x[j])>k:
            ans = ':('

print(ans)

Submission status: Accepted

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

seq = [a, b, c, d, e]
ans = "Yay!"

for i in range(5):
	for j in range(i, 5):
		buf = seq[i] - seq[j]
		if abs(buf) > k:
			ans = ":("
			
print(ans)

Submission status: Accepted

Solution code:
#A-Five Antennas(ABC123)
X=[int(input()) for i in range(5)]
K=int(input())
X.sort()
if (X[4]-X[0])<=K:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(6)]
b = 0
m = 'Yay!'

if abs(a[0]-a[1]) > a[5]:
    m = ':('
elif abs(a[0]-a[2]) > a[5]:
    m = ':('
elif abs(a[0]-a[3]) > a[5]:
    m = ':('
elif abs(a[0]-a[4]) > a[5]:
    m = ':('
elif abs(a[1]-a[2]) > a[5]:
    m = ':('
elif abs(a[1]-a[3]) > a[5]:
    m = ':('
elif abs(a[1]-a[4]) > a[5]:
    m = ':('
elif abs(a[2]-a[3]) > a[5]:
    m = ':('
elif abs(a[2]-a[4]) > a[5]:
    m = ':('
elif abs(a[3]-a[4]) > a[5]:
    m = ':('

print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
abcde = [int(input()) for _ in range(5)]
k = int(input())

for x in abcde:
  for y in abcde:
    if abs(x - y) > k:
      print(':(')
      exit(0)

print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
L=[0 for i in range(5)]
for i in range(5):
  L[i]=int(input())
  
k=int(input())

for i in range(4):
  for j in range(i+1,5):
    if L[j]-L[i]>k:
      print(':(')
      sys.exit()
  
    if i==2 and j==3:
      print('Yay!')

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

k = int(input())

for i in range(len(antennas)):
    for j in range(i + 1,len(antennas)):
        if antennas[j] - antennas[i] > k:
            print(":(")
            exit(0)

print('Yay!')

Submission status: Accepted

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

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

Submission status: Accepted

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

x=sorted([a,b,c,d,e])
if x[4]-x[0]>k:
  print(':(')
  sys.exit()
print('Yay!')

Submission status: Accepted

Solution code:
import sys
list_ = []
for i in range(5):
    list_.append(int(input()))
k =int(input())
for i in range(5):
    for j in range(5):
        diff = list_[i]-list_[j]
        if abs(diff) > 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-d>k or e-c>k or e-b>k or e-a>k or d-c>k or d-b>k or d-a>k or c-b>k or c-a>k or b-a>k:
	print(":(")
else:
	print("Yay!")

Submission status: Accepted

Solution code:
x=[]
for i in range(5):
    x.append(int(input()))
k=int(input())
s="Yay!"
for i in range(5):
    for j in range(5-i-1):
        if abs(x[i+j+1]-x[i])>k:
            s=":("
            break
    if s==":(":
        break
print(s)

Submission status: Accepted

Solution code:
import math

inputList=[]
for i in range(6):
    inputNum = input()
    inputList.append(inputNum)
# inputa = input().split()

# inputb = input()

# a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# inputList = list(inputb)
#
# inputList[b-1] = inputList[b-1].lower()
#
# ans = "".join(inputList)



# inputList.sort()
#
# list = [a+b, b+c ,c+a]
#
# ans = min(list)
# print(ans)



flg = 1

if int(inputList[4])-int(inputList[0]) > int(inputList[5]):
    flg = 0

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

Submission status: Accepted

Solution code:
def solve():
    a, b, c, d, e = [int(input()) for _ in range(5)]
    k = int(input())
    return ":(" if e - a > k else "Yay!"


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline

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

for i in a:
    for j in a:
        if i == j:
            continue
        if j - i > k:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

Solution code:
def test():
    a = []
    count = 0

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

    b = max(a)
    b -= min(a)

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


if __name__ == "__main__":
    test()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import numpy as np

A = np.array([])

A = np.append(A, int(input()))
A = np.append(A, int(input()))
A = np.append(A, int(input()))
A = np.append(A, int(input()))
A = np.append(A, int(input()))
k = int(input())

if (np.max(A)-np.min(A)) > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
def inputNum():
    numList = []
    for i in range(5):
        numList.append(int(input()))
    return numList


def kJudge(k):
    for i in range(0, 4):
        for j in range(i, 5):
            if abs(numList[i] - numList[j]) > k:
                return ":("
    return "Yay!"


numList = inputNum()
k = int(input())
print(kJudge(k))

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

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

for x1 in X:
    for x2 in X:
        if abs(x1-x2) > k:
            print(":(")
            sys.exit()
print("Yay!")

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, b, c, d, e, k = [int(input()) for i in range(6)]

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

Submission status: Accepted

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

ANS=[0]*10

ANS[0]=b-a
ANS[1]=c-a
ANS[2]=d-a
ANS[3]=e-a
ANS[4]=c-b
ANS[5]=d-b
ANS[6]=e-b
ANS[7]=d-c
ANS[8]=e-c
ANS[9]=e-d

flag=0

for i in range(0,10):
    if ANS[i]>k:
        flag+=1
        
if flag==0:
    print('Yay!')
else :
    print(':(')

Submission status: Accepted

Solution code:
a,*_,e,k=map(int,open(0).read().split())
print(':(' if k < (e-a) else 'Yay!')

Submission status: Accepted

Solution code:
a,b,c,d,e,k=map(int,open(0).read().split())
print(':(' if k < (e-a) else 'Yay!')

Submission status: Accepted

Solution code:
antennas = list(int(input()) for _ in range(5))
k = int(input())

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

Submission status: Accepted

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

for i in range(len(a)):
    for j in range(i+1,len(a)):
        if abs(a[i] - a[j]) <= k:
            pass
        else:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(int,(input(), input(), input(), input(), input())))
k = int(input())
print(":(" if s[4]-s[0] > k else "Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

if max(antennas) - min(antennas) > k:
    print(":(")
    exit()

print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lst = list()
for i in range(0, 6):
    a = int(input())
    lst.append(a)

cnt = 0

for i in range(1,len(lst)-1):
    diff = abs(lst[0] - lst[i])
    if diff > lst[-1]:
        cnt += 1
        print(':(')
        break

if cnt > 0:
    pass
else:
    for i in range(2, len(lst)-1):
        diff = abs(lst[1] - lst[i])
        if diff > lst[-1]:
            cnt += 1
            print(':(')
            break

if cnt > 0:
    pass
else:
    for i in range(3, len(lst)-1):
        diff = abs(lst[1] - lst[i])
        if diff > lst[-1]:
            cnt += 1
            print(':(')
            break

if cnt > 0:
    pass
else:
    for i in range(4, len(lst)-1):
        diff = abs(lst[1] - lst[i])
        if diff > lst[-1]:
            cnt += 1
            print(':(')
            break

if cnt == 0:
    print('Yay!')

Submission status: Accepted

Solution code:
l = []
for i in range(6):
    if i <= 4:
        l.append(int(input()))
    else:
        k = int(input())

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

Submission status: Accepted

Solution code:
A = []
for i in range(5):
  A.append(int(input()))
k = int(input())
ans = True
for i in range(4):
  for j in range(i, 5):
    if abs(A[i] - A[j]) > k:
      ans = False
      break
if ans:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

Solution code:
n = [int(input()) for i in range(5)]
k = int(input())
if n[4] - n[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())

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

if max(list)-min(list)<=k:
    print('Yay!')
else:
    print(':(')

Submission status: Accepted

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

m='Yay!'
for i in range(5):
  for j in range(5):
    if abs(l[i]-l[j])>N:
      m=':('
    
print(m)

Submission status: Accepted

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

L = []
cnt = 0

ab = abs(a-b)
ac = abs(a-c)
ad = abs(a-d)
ae = abs(a-e)
bc = abs(b-c)
bd = abs(b-d)
be = abs(b-e)
cd = abs(c-d)
ce = abs(c-e)
de = abs(d-e)

L.append(ab)
L.append(ac)
L.append(ad)
L.append(ae)
L.append(bc)
L.append(bd)
L.append(be)
L.append(cd)
L.append(ce)
L.append(de)

for l in L:
    if l > k:
        print(':(')
        break
    else:
        cnt += 1
        if cnt == 5:
            print('Yay!')

Submission status: Accepted

Solution code:
a = [int(input()) 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())
flag = True
if e - a > k:
  flag = False
if flag == True:
  print("Yay!")
else:
  print(":(")

Submission status: Accepted

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

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

ans = "Yay!"
for i in range(len(A)):
    for j in range(i+1, len(A)):
        p, q = A[i], A[j]
        d = q - p
        if d > k:
            ans = ":("

print(ans)

Submission status: Accepted

Solution code:
kyori = []
for i in range(5):
    kyori += [int(input())]
a = kyori[0]
e = kyori[-1]
k = int(input())

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

Submission status: Accepted

Solution code:

kyori = []
for i in range(5):
    kyori += [int(input())]
k = int(input())

for i in range(1, len(kyori)+1):
    left = kyori[:i]
    right = kyori[i:]
    base = left[-1]

    for r in right:
        if abs(base - r) > 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(':(')
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:
data = [int(input()) for _ in range(5)]
m = int(input())
if m >= (data[4] - data[0]):
  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(":(")
else:
  print("Yay!")

Submission status: Accepted

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

for n in range(5):
    for m in range(5):
        if n != m:
            if abs(A[n]-A[m])>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:
import numpy as np

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

k = int(input())

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

Submission status: Accepted

Solution code:
import sys

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

for j in range(5):
  if int(N[j]) - int(N[0]) > int(N[5]):
    print(":(")
    sys.exit()
print("Yay!")

Submission status: Accepted

Solution code:
# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy

l = [int(input()) for _ 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:
ant = [int(input()) for i in range(6)]

if ant[-2] - ant[0] > ant[-1]:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

Solution code:
a=list(map(int,open(0)));print(["Yay!",":("][max(a[:5])-min(a[:5])>a[5]])

Submission status: Accepted

Solution code:
a, b, c, d, e, k = map(int, open(0))
print(["Yay!", ":("][max(a, b, c, d, e) - min (a, b, c, d, e) > k])

Submission status: Accepted

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

# print(a)
# print(b)
# print(c)
# print(d)
# print(e)
# print(k)

# print(e - a)

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc123/tasks/abc123_a
# A - Five Antennas

import itertools

place_list = []

for _ in range(5):
    place_list.append(int(input().split()[0]))

k = int(input().split()[0])

p = itertools.combinations(place_list, 2)

is_ok = True

for p_1, p_2 in p:
    if abs(p_1 - p_2) > k:
        is_ok = False

ans = 'Yay!' if is_ok else ':('

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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:
# Five Antennas
li = [int(input()) for x in range(6)]

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