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:
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:
a,*_,e,k=map(int,open(0).read().split());print(':('*(e-a>k)or'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:
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

A=rr(6)
k=A[-1]
if A[-2]-A[0] > k:
    print(":(")
else:
    print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

abcde = [ni() for _ in range(5)]
k = ni()
if abcde[-1] - abcde[0] > k:
    print(":(")
else:
    print("Yay!")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if max(a,b,c,d,e) - min(a,b,c,d,e) <= 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,b,c,d,e,k=[int(input()) for _ in range(6)]
A=[a,b,c,d,e]
A.sort()
if abs(A[0]-A[-1])>k:
  print(':(')
else:
  print('Yay!')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
# import numpy as np
INF = float("inf")


def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    if e-a > k:
        print(":(")
    else:
        print("Yay!")
    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:
#!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
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

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

#B
def B():
    n = I()
    return

#C
def C():
    n = I()
    return

#D
def D():
    n = I()
    return

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

Submission status: Accepted

Solution code:


import itertools
import collections
import bisect

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(){
  int a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;
  
  if( e - a > k){
    cout << ":(";
  }else{
    cout << "Yay!";
  }
}

Submission status: Runtime Error

Solution code:
x,y,z,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
b=sorted(list(map(int,input().split())),reverse=True)
c=sorted(list(map(int,input().split())),reverse=True)
ab=[]
for i in range(x):
    for j in range(y):
        ab.append(a[i]+b[j])
ab.sort(reverse=True)
ans=[]
for i in range(min(k,x*y)):
    for j in range(z):
        ans.append(ab[i]+c[j])
ans.sort(reverse=True)
for i in range(k):
    print(ans[i])

Submission status: Runtime Error

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

l = []
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)
ans = 0
for i in range(5):
    for j in range(i+1,5):
        if l[j] - l[i] > k :
            ans += 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input()
b=int(input()
c=int(input()
d=int(input()
e=int(input()
x=int(input()
ls=[a,b,c,d,e]
ls.sort()
if (ls[1]-ls[0])<=x and (ls[2]-ls[1])<=x and (ls[3]-ls[2])<=x and (ls[4]-ls[3])<=x:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a=int(input()
b=int(input()
c=int(input()
d=int(input()
e=int(input()
x=int(input()
ls=[a,b,c,d,e]
ls.sort()
if ls[1]-ls[0]<=x and ls[2]-ls[1]<=x and ls[3]-ls[2]<=x and ls[4]-ls[3]<=x:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C, D, E = map(int, readline().split())

    if E - A > K:
        print(':(')
    else:
        print('Yay!')

    return


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c,d,e,k=map(int,input().split())
if e-a>k:print(":(")
else:print("Yey!")

Submission status: Runtime Error

Solution code:
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: Runtime Error

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

Submission status: Runtime Error

Solution code:
or i in range(5):
    I=list(map(int,input().split()))
k=int(input())
if max(I)-min(I)<=k:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
for i in range(5):
    I=list(int(input()))
k=int(input())
if max(I)-min(I)<=k:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

isOK=True

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

Submission status: Runtime Error

Solution code:
antena = []
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(":(")
else:
  print("Yay!")

Submission status: Runtime Error

Solution code:
a,b,c,d,e = [int(input()) for _ in range(4)]
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: Runtime Error

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: Runtime Error

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

if max(v) > k:
  print(":(")
else:
  print(("Yay!")

Submission status: Runtime Error

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

for i in range(4):
  for j in range(4):
    if l[i]*l[j]>l[4]:
      print(":(")
      break
    else:
      print("Yay!")

Submission status: Runtime Error

Solution code:
l = list(map(int,input().split()))

for i in range(4):
  for j in range(4):
    if l[i]*l[j]>k:
      print(":(")
      break
    else:
      print("Yay!")

Submission status: Runtime Error

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 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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = [int(input()) for i in range(5)]
k = int(input())
print("Yey!" if e-a<= k else ":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
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: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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]
for i in range(len(List)):
    for j in range(i+1,len(List)+1):
        if List[j]-List[i]>k:
            print(":(")
            exit()
print("Yay!")

Submission status: Runtime Error

Solution code:
v=map(int,open(0).read().split())
if v[5]>=v[4]-v[0]:
  print("Yay")
else:
  print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ns=list(a,b,c,d,e)
ns.sort()
if ns[4]-ns[0]<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ns=list[a,b,c,d,e]
ns.sort()
if ns[0]-ns[4]<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ns=list[a,b,c,d,e]
ns.sort()
if ns[4]-ns[0]<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
ns=list(map(int(input().spllit()))
k=int(input())
ns.sort()
if n[4]-n[0]<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ns=list[a,b,c,d,e]
ns.sort()
if e-a<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ns=list[a,b,c,d,e]
ns.sort()
if b-a<=k and c-b<=k and d-c<=k and e-d<=k:
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ns=list[a,b,c,d,e]
ns.sort()
if b-a<=k or c-b<=k or d-c<=k or e-d<=k:
  print("Yay!")
else:
  print(:("")

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
ns=list[a,b,c,d,e]
ns.sort()
if b-a<=k or c-b<=k or d-c<=k or e-d<=k:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

else:
  print(':(')

Submission status: Runtime Error

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

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>k:
  print(':(')
if y<=k:
  print('Yay!')

Submission status: Runtime Error

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

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>k:
  print(':(')
else:
  print('Yay!')

Submission status: Runtime Error

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

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>=k:
  print('Yay!')
else:
  print(':(')

Submission status: Runtime Error

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

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>=k:
  print('Yay!')
else:
  print(':(')

Submission status: Runtime Error

Solution code:
ma = 0
mi = 123
for i in range(5):
  x = input()
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi > input():
  print("Yay!")
else:
  print(":(")

Submission status: Runtime Error

Solution code:
for i in range(5):l.append(int(input()))
k=int(input())
c=0
for i in l:
    for j in l:
        if abs(i-j)>k:c+=1
print('Yay!' if c==0 else ':(')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
from sys import exit

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

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

Submission status: Runtime Error

Solution code:
# ABC123A

import numpy as np
a = [0] * 5
for i in range(5):
    a[i] = int(input())
k = int(input())
a = np.array(a)
print(":(" if np.sum(abs(np.subtract.outer(a, a)) > k) > 0 else "Yay!")

ABC123A([1,2,4,8,9], 15)
ABC123A([15, 18, 26, 35, 36], 18)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
ab = b-a
ac = c-a
ad = d-a
ae = e-a
bc = c-b
bd = d-b
be = e-b
cd = d-c
ce = e-c
de = e-d
if ab <=	k and ac <= k and ad <= k	and ae <= k and bc <= k and bd <= k and be <= k and cd <= k and ce <= k and d\
e <= k:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

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]

i = 0

f = 'True'

for i in range(4):
	kyori = list[i+1] - list[i]
    i += 1
    if kyori > k:
    	f = 'False'
        break

if f = 'False':
	print( ':(')
elif f = 'True':
	print('Yay!')

Submission status: Runtime Error

Solution code:
X,Y,Z,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

K=min(K,3000)

AB=[a+b for a in A for b in B]
AB.sort(reverse=True)

ABC=[ab+c for ab in AB[:K] for c in C]
ABC.sort(reverse=True)

for k in range(K):
	print(ABC[k])

Submission status: Runtime Error

Solution code:
X,Y,Z,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

K=min(K,3000)

AB=[a+b for a in A for b in B]
AB.sort(reverse=True)

ABC=[ab+c for ab in AB[:K] for c in C[:K]]
ABC.sort(reverse=True)

for k in range(K):
	print(ABC[k])

Submission status: Runtime Error

Solution code:
a = list(int(input()) for _  in range(5))
k = int(input())
ans='Yay!'
for i in a:
  for j in len(a):
    if a[j] - i >k:
      ans = ':('
print(ans)

Submission status: Runtime Error

Solution code:
a = list(int(input()) for _  in range(5))
k = int(input())
ans='Yay!'
for i in a:
  for j in len(a):
    if a[j] - i >18:
      ans = ':('
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = "Yay!"

a = aaa[0]
for i in range(1,5):
	if aaa[5] >= a - aaa[i]:
    	ans = ":("
      	break
   
 print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

v=b-a
w=c-b
x=d-c
y=e-d

z=max(max(v,w),max(x,y))

if z >k:
  print(':')
else:
  print('Yay!')

Submission status: Runtime Error

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

v=b-a
w=c-b
x=d-c
y=e-d

z=max(max(v,w),max(x,y))

if z >k:
  print(':')
else:
  print('Yay!)

Submission status: Runtime Error

Solution code:
from itertools import combinations

line = input()
ant = [int(n) for n in line.split()]
comb = tuple(combinations(ant[:5], 2))

for i,j in comb:
    if j-i > ant[5]:
        a = -1
        print(":(")
        break
    else:
        pass
if a != -1:
    print("Yay!")

Submission status: Runtime Error

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

if 0 < a <= 123:
    if 0 < b <= 123:
        if 0 < c <= 123:
            if 0 < d <= 123:
                if 0 < e <= 123:
                    if 0 < k <= 123:
                        if a < b:
                            if b < c:
                                if c < d:
                                    if d < e:
                                        ab = b - a
                                        ac = c - a
                                        ad = d - a
                                        ae = e - a
                                        bc = c - b
                                        bd = d - b
                                        be = e - b
                                        cd = d - c
                                        ce = e - c
                                        de = e - d

                                        lista = [ab, ac, ad, ae, bc, bd, be, cd, ce, de]
                                        x = max(lista)
if x <= 15:
     print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
if 0 < a <= 123:
    if 0 < b <= 123:
        if 0 < c <= 123:
            if 0 < d <= 123:
                if 0 < e <= 123:
                    if 0 < k <= 123:
                        if a < b:
                            if b < c:
                                if c < d:
                                    if d < e:
                                        ab = b - a
                                        ac = c - a
                                        ad = d - a
                                        ae = e - a
                                        bc = c - b
                                        bd = d - b
                                        be = e - b
                                        cd = d - c
                                        ce = e - c
                                        de = e - d

                                        lista = [ab, ac, ad, ae, bc, bd, be, cd, ce, de]
                                        x = max(lista)

                        if x <= 15:
                            print("Yay!")
                        else:
                            print(":(")

Submission status: Runtime Error

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

if a < b :
    if b < c :
        if c < d:
            if d < e:
                if e < k:
                    ab = b-a
                    ac = c-a
                    ad = d-a
                    ae = e-a
                    bc = c-b
                    bd = d-b
                    be = e-b
                    cd = d-c
                    ce = e-c
                    de = e-d

                    lista = [ab,ac,ad,ae,bc,bd,be,cd,ce,de]
                    x = max(lista)

if x <= 15:
    print("Yay!")
else:
    print(":(")

Submission status: Runtime Error

Solution code:
while True:
    try:
        line = input()
        res = ""
        for i in range(len(line)-2):
            if line[i+1]-line[i]<= line[-1]:
                res = "Yay!"
            else:
                res = ":("
                break
        print(res)
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
line = input()
numbers = [int(n) for n in line.split()]
predicted_value = "Yay!"
k_distance = numbers[-1]
antenas = numbers[:-1]
antenas.sort()
if antenas[-1] - antenas[0] > k_distance:
    predicted_value = ":("
print(predicted_value)

Submission status: Runtime Error

Solution code:
aru = False
antenas = []
for i in range(5):
  k=int(input())
  antenas.append(n)
k=int(input())
for i in range(4):
  if abs(antenas[i]-antenas[i+1])>k:
    aru = True
if aru:
  print(':(')
else:
  print("Yay!")

Submission status: Runtime Error

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

max_dist = int(input())

coords = {}

for i in range(len(antennas)):
  coords[i] = antennas[i]
flag = 1
for i in range():
  for j in range(i + 1, 5):
    if abs(coords[i] - coords[j]) > max_dist:
      print(':(')
      flag = 0
      break
  if flag == 0:
    break
if flag == 1:
  print('Yay!')

Submission status: Runtime Error

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

max_dist = int(input())

coords = {}

for i in range(len(antennas)):
  coords[i] = antennas[i]
flag = 1
for i in range():
  for j in range(i + 1, 5):
    if abs(coords[i] - coords[j]) > max_dist:
      print(':(')
      flag = 0
      break
  if flag = 0:
    break
if flag = 1:
  print('Yay!')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a.b.c.d.e.k=map(int,input().split())
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("Yey!")

Submission status: Runtime Error

Solution code:
a.b.c.d.e.k=map(int,input().split())
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 abs(c-d)<=k and abs(c-e)<=k and abs(d-e)<=k:
  print("Yey!")
else:
  print(":(")