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:
AE = [int(input()) for _ in range(5)]
k = int(input())
flag = True
for yy in AE:
    for xx in AE:
        if abs(xx-yy) > k:
            flag = False
if flag:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

YES = 'Yay!'
NO =  ':('

def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    if (b - a > k or c - b > k or d - c > k or e - d > k or 
       c - a > k or d - b > k or e - c > k or d > k or
       d - a > k or e - b > k or e - a > k):
        ret = NO
    else:
        ret = YES
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    e = int(next(tokens))  # type: int
    k = int(next(tokens))  # type: int
    solve(a, b, c, d, e, k)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
input()
input()
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())

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

Submission status: Accepted

Solution code:
def main(m, k):
    # print(m)
    d = max(m) - min(m)
    if d > k:
        return ':('
    else:
        return 'Yay!'
    
if __name__ == '__main__':
    try:
        m = []
        for i in range(5):
            m.append(int(input().strip()))
        k = int(input().strip())
        print('{}'.format(main(m, k)))
    except EOFError:
        pass

Submission status: Accepted

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

for ai in A:
    for aj in A:
        if abs(aj - ai) > k:
            print(":(")
            quit()
print("Yay!")

Submission status: Accepted

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

ok = True
for i in range(5):
    for j in range(5):
        if abs(a[i] - a[j]) > k:
            ok = False

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

Submission status: Accepted

Solution code:
a = int(input())
for _ in range(3):
    b = int(input())
e = int(input())
k = int(input())

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

Submission status: Accepted

Solution code:
#map(int, input().split())
l = [int(input()) for _ in range(5)]
k = int(input())

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

Submission status: Accepted

Solution code:
import numpy as np
import sys

a = np.zeros(5)
for i in range(5):
    a[i] = int(input())

k = int(input())

r = a.max() - a.min() <= k
print("Yay!" if r else ":(")

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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:
import sys
A = []
for _ in range(5):
  A.append(int(input()))
k = int(input())
for i in range(4):
  for j in range(i+1, 5):
    if A[j]-A[i] > k:
      print(':(')
      sys.exit()
print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
nums = []
nums.append(a)
nums.append(b)
nums.append(c)
nums.append(d)
nums.append(e)
ans = 0
for i in nums:
    for j in nums:
        if abs(i-j)>k:
            ans+=1
if ans==0:
    print("Yay!")
else:
    print(":(")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
  ABCDEF = [int(input()) for i in range(5)]
  K = int(input())
  return ':(' if max(ABCDEF) - min(ABCDEF) > K else 'Yay!'

print(solve())

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    A = [int(input()) for _ in range(5)]
    K = int(input())

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


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

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(5):
    if abs(l[i] -l[j]) >k:
      print(":(")
      quit()
else:
  print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
nums = [int(input()) for i in range(5)]
k = int(input())
ans = 'Yay!'
for i in range(5):
    for l in range(i+1, 5):
        if nums[l] - nums[i] > k:
            ans = ':('
            break
print(ans)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

dist = int(input())
if abs(pos[0] - pos[-1]) > dist:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

Solution code:
import sys
from itertools import permutations

inputs = []

for _ in range(5):
    inputs.append(int(sys.stdin.readline()))
k = int(sys.stdin.readline())


flag = True
for i, j in permutations(inputs, 2):
    if abs(i - j) > k:
        flag = False
        break

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

Submission status: Accepted

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

for i in range(5):
    for j in range(5):
        if abs(l[i]-l[j]) <= k:
            continue
        else:
            print(":(")
            exit()
print("Yay!")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

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:
#!/usr/bin/python3

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int,ss_raw()))


poss = []
for i in range(5):
    p = int_raw()
    poss.append(p)
k = int_raw()

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

print(main())

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()) for i in range(5)]
k = int(input())
if a[4]-a[0] > k:
	print(":(")
	exit()
print("Yay!")

Submission status: Accepted

Solution code:
l = []

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

a = [int(input()) for i in range(5)]
k = int(input())
flag = 1
for i in itertools.combinations(a, 2):
    if abs(i[0] - i[1]) > k:
        flag = 0
if flag:
    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(":(")
else:
  print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
mina, maxa = 130, 0
for _ in range(5):
  a = int(input())
  mina = min(a, mina)
  maxa = max(a, maxa)

k = int(input())
if maxa - mina > 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())
print("Yay!" if e-a<=k else ":(")

Submission status: Accepted

Solution code:
A = list(int(input()) for _ in range(5))
K = int(input())
ans = 'Yay!'
for i in range(5):
    for j in range(5):
        if not  - K <= A[i] - A[j] <= K:
            ans = ':('
print(ans)

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 = []
for i in range(5):
    a.append(int(input()))
k = int(input())
flag = True
for i in range(4):
    for j in range(i+1, 5):
        if abs(a[j]-a[i]) >k:
            flag= False
            break
if flag:
    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())

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

print(output)

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:
  print(":(")
  exit()
if c-b >k:
  print(":(")
  exit()
if d-c >k:
  print(":(")
  exit()
if e-a >k:
  print(":(")
  exit()
print("Yay!")

Submission status: Accepted

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

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:
#!/usr/bin/env python3

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

Submission status: Accepted

Solution code:
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())
if max(a) - min(a) > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

Solution code:
# coding: utf-8

a = [int(input()) for _ in range(5)]
k = int(input())
flag = True

for i in range(5):
  for j in range(5):
    if abs(a[i] - a[j]) > k:
      flag = False
      break

if flag:
  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 k < e - a else '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("Yay!")
else:
    print(":(")

Submission status: Accepted

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

ans = "Yay!"

if A[-1] - A[0] > k :
    ans = ":("
print(ans)

Submission status: Accepted

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

a.sort()

k = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
# import numpy as np

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()


points = []
for _ in range(5):
    points.append(d_in())
k = d_in()

max_dist = -1
for i in range(5):
    for j in range(i+1, 5):
        max_dist = max(max_dist, abs(points[i] - points[j]))

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

Submission status: Accepted

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

k = int(input())

ans = 0
for i in z:
    for j in z:
        if i >= j:
            continue
        if j - i > k:
            ans += 1

if ans > 0:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = IR(5)
    k = II()
    if max(a) - min(a) > k:
        print(":(")
    else:
        print("Yay!")
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

num.sort()
diff = num[4] - num[0]

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

Submission status: Accepted

Solution code:
def solve():
    a=[0]*5
    for i in range(5):
        a[i]=int(input())
    k=int(input())
    if a[4]-a[0]<=k:
        return 'Yay!'
    else:
        return ':('

print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# import bisect
# import math
# import itertools
# import numpy as np
# import collections

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e, p = range, enumerate, print
    ip = IP()
    id = Idea()
    mod = 10 ** 9 + 7

    """この下から書いてね"""
    li = ip.ILS(5)
    k = ip.I()
    if max(li) - min(li) <= k:
        p("Yay!")
    else:
        p(":(")


main()

Submission status: Accepted

Solution code:

import atexit
import io
import sys

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())

l = []
for i in xrange(5):
	l.append(input())
k = input()
ans = 'Yay!'
for i in xrange(5):
	for j in xrange(5):
		if abs(l[i]-l[j]) > k:
			ans = ':('
print ans

Submission status: Accepted

Solution code:
import math
import sys

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

for i in range(5):
        for j in range(5):
                if a[i]-a[j]>k:
                        print(":(")
                        sys.exit()

print("Yay!")

Submission status: Accepted

Solution code:
a=int(input())
s=int(input())
d=int(input())
f=int(input())
g=int(input())
h=int(input())
if g-a>h:
  print(":(")
else:
  print("Yay!")

Submission status: Accepted

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

k = int(input())

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

Submission status: Accepted

Solution code:
ps, k = [int(input()), int(input()), int(input()), int(input()), int(input())], int(input())
f = True
for i in range(0, 5):
    for j in range(0, 5):
        if ps[j] - ps[i] > k:
            f = False
print('Yay!' if f else ':(')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

print(':(' if max(a)-min(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 e - a > k:
    print(':(')
else:
    print('Yay!')

Submission status: Accepted

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

bl = True
for ee1 in e:
    for ee2 in e:
        if abs(ee1 - ee2) > k:
            bl = False
            break
    if not bl:
        break
print('Yay!' if bl else ':(')

Submission status: Accepted

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

print("Yay!")

Submission status: Accepted

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


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


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

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

Submission status: Accepted

Solution code:
A=[int(input()) for i 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:
      print(':(')
      exit()
print("Yay!")

Submission status: Accepted

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

  
solve()

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


# globals
inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    # ----------MAIN----------
    a = get_int()
    b = get_int()
    c = get_int()
    d = get_int()
    e = get_int()
    k = get_int()
    if abs(a - e) > k:
        print(":(")
    else:
        print("Yay!")
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split(sep=sep))]
        for _ in range(n)
    )))


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