CodeEff/ECCO huggingface dataset:
# Original solution
N, *D, = [list(map(int, s.split())) for s in open(0)]
N, D = N[0], D[0]
takoyaki_sum = 0
for i in range(N):
    for j in range(N):
        if i != j:
            takoyaki_sum += D[i]*D[j] 
        
print((int(takoyaki_sum/2)))

# Optimized solution
def main():
    _ = int(eval(input()))
    a = list(map(int, input().split()))
    total = 0
    for i in range(len(a)-1):
        for j in range(i+1, len(a)):
            total += a[i]*a[j]
    print(total)


if __name__ == "__main__":
    main()
# Original solution
N = int(eval(input()))
D = list(map(int, input().split()))

res = 0
for i in range(N):
    res += sum(D[i + 1:])*D[i]
print(res)

# Optimized solution
N = int(eval(input()))
D = list(map(int, input().split()))

s = sum(D)
sq = 0
for i in range(N):
    sq += D[i]**2
print(((s**2 - sq)//2))
# Original solution
n = int(eval(input()))
d = list(map(int, input().split()))

sum = 0
for i in range(n):
    for j in range(i+1):
        if(i != j):
            sum += d[i] * d[j]

print(sum)


# Optimized solution
n = int(eval(input()))
d = list(map(int, input().split()))

sum = 0
for i in range(n):
    for j in range(i):
        sum += d[i] * d[j]

print(sum)
# Original solution
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(eval(input()))
    D=list(map(int,input().split()))
    ans=0
    for i in range(n):
        for j in range(i+1,n):
            ans+=D[i]*D[j]
    print(ans)
resolve()

# Optimized solution
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n=int(eval(input()))
    A=list(map(int,input().split()))
    s=sum(A)
    t=sum(a**2 for a in A)
    print(((s**2-t)//2))
resolve()
# Original solution
import itertools

n = int(eval(input()))
D = list(map(int, input().split()))

l1 = [x for x in range(n)]
l2 = [x for x in range(n)]

ans = 0
sub = 0

for v1, v2 in itertools.product(l1, l2):
    ans += D[v1] * D[v2]

for i in range(n):
    sub += D[i]*D[i]

print(((ans-sub)//2))

# Optimized solution
n = int(eval(input()))
D = list(map(int, input().split()))

ans = 0
for i in range(n-1):
    for j in range(i+1, n):
        ans += D[i]*D[j]

print(ans)
# Original solution
n = int(eval(input()))
d = list(map(int, input().split()))
s = 0

for i in range(n):
    for j in range(n):
        if i != j:
            s += d[i]*d[j]

s //= 2

print(s)


# Optimized solution
n = int(eval(input()))
d = list(map(int, input().split()))
s = 0

for i in range(n-1):
    for j in range(i+1, n):
        s += d[i]*d[j]

print(s)
# Original solution
import itertools
N=int(eval(input()))
d_list=[int(i) for i in input().split()]
comb = list(itertools.combinations(d_list, 2))
sum_heal = 0
for i,j in comb:
    sum_heal += i*j
print(sum_heal)

# Optimized solution
N=int(eval(input()))
d_list=[int(i) for i in input().split()]
sum_heal = 0 
for i in range(N):
    for j in range(i+1, N):
        sum_heal += d_list[i]*d_list[j]
print(sum_heal)
# Original solution
import itertools
n=int(eval(input()))
takoyaki=list(map(int,input().split()))
combs=list(itertools.combinations(takoyaki,2))
recovery=list(c[0]*c[1] for c in combs)
print((sum(recovery)))

# Optimized solution
n=int(eval(input()))
d=list(map(int,input().split()))
tot=sum(d)**2
for i in range(n):
  tot-=d[i]**2
print((tot//2))
# Original solution
n=int(eval(input()))
d=list(map(int,input().split()))
sm=0
for i in range(len(d)-1):
  for j in range(i+1,len(d)):
    sm+=d[i]*d[j]
print(sm)

# Optimized solution
n=int(eval(input()))
d=list(map(int,input().split()))
d2=[m**2 for m in d]
print(((sum(d)**2-sum(d2))//2))
# Original solution
n = int(eval(input()))
l=list(map(int,input().split()))
sum = 0
for i in range(len(l)):
	for j in range(i+1,len(l)):
		sum += l[i]*l[j]
print(sum)

# Optimized solution
n = int(eval(input()))
list = list(map(int,input().split()))
sum = 0
for i in range(len(list)):
	for j in range(i+1,len(list)):
		sum +=list[i]*list[j]
print(sum)
# Original solution
N=int(eval(input()))
d=[int(i) for i in input().split()]
X=sum([i*i for i in d])
print(((sum(d)**2-X)//2))


# Optimized solution
N=int(eval(input()))
d=[int(i) for i in input().split()]
ans=0
for i in range(N):
  for j in range(i+1,N):
    ans+=d[i]*d[j]
print(ans)
# Original solution
N=int(eval(input()))
d=[int(i) for i in input().split()]
ans=0
for i in range(N):
  for j in range(i+1,N):
    ans+=d[i]*d[j]
print(ans)


# Optimized solution
N=int(eval(input()))
d=[int(i) for i in input().split()]
X=sum([i*i for i in d])
print(((sum(d)**2-X)//2))
# Original solution
#!/usr/bin/env python

def main():
    N = int(eval(input()))
    D = list(map(int, input().split()))
    ans = 0
    for i in range(N-1):
        d1 = D[i]
        for d2 in D[i+1:]:
            ans += d1 * d2

    print(ans)

if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python

def main():
    N = int(eval(input()))
    d = list(map(int, input().split()))

    cumSum = [0] * N
    cumSum[0] = d[0]
    for i in range(1, N):
        cumSum[i] = cumSum[i-1] + d[i]

    ans = 0
    for i in range(N-1):
        ans += d[i] * (cumSum[N-1] - cumSum[i])

    print(ans)

if __name__ == '__main__':
    main()
# Original solution
N=int(eval(input()))
d=list(map(int,input().split()))
print((sum(d[x]*d[y] for x in range(N) for y in range(x+1,N))))

# Optimized solution
import itertools
N=int(eval(input()))
D=list(map(int,input().split()))
print((sum(d*cumulate for d,cumulate in zip(D[1:],itertools.accumulate(D)))))
# Original solution
eval(input())
*l,=list(map(int,input().split()))
ans=0
for i in l:
    for j in l:
        ans+=i*j
print(((ans-sum([x*y for (x, y) in zip(l,l)]))//2))

# Optimized solution
eval(input())
*l,=list(map(int,input().split()))
ans=0
for i in l:
    for j in l:
        ans+=i*j
print(((ans-sum([pow(x,2) for x in l]))//2))
# Original solution
eval(input())
*l,=list(map(int,input().split()))
ans=0
for i in l:
    for j in l:
        ans+=i*j
print(((ans-sum([pow(x,2) for x in l]))//2))

# Optimized solution
eval(input())
*l,=list(map(int,input().split()))
print(((pow(sum(l),2)-sum([pow(x,2) for x in l]))//2))
# Original solution
import itertools

n = int(eval(input()))
d = list(map(int, input().split()))

recovery = 0
for i in itertools.combinations(list(range(n)), 2):
    recovery += d[i[0]] * d[i[1]]
print(recovery)

# Optimized solution
n = int(eval(input()))
d = list(map(int, input().split()))
sum_mul = sum(d)

recovery = 0
for i in range(n):
    sum_mul -= d[i]
    recovery += d[i] * sum_mul

print(recovery)
# Original solution
N,*D = list(map(int,open(0).read().split()))
import itertools
print((sum(a * b for a,b in itertools.combinations(D,2))))

# Optimized solution
N,*D = list(map(int,open(0).read().split()))

cum = 0
ans = 0
for i in range(1,len(D)):
  cum += D[i - 1]
  ans += D[i] * cum
print(ans)
# Original solution
n = int(eval(input()))
ds = [int(x) for x in input().split()]
ds2 = [x*x for x in ds]
s = sum(ds)
print((int((sum(ds * s) - sum(ds2)) / 2 )))

# Optimized solution
n = int(eval(input()))
ds = [int(x) for x in input().split()]
ds2 = [x*x for x in ds]
s = 0
s2 = 0
for i in range(n):
  s += ds[i]
  s2 += ds2[i]
ss = 0
for i in range(n):
  ss += ds[i] * s

print(((ss - s2) // 2))
# Original solution
n = int(eval(input()))
d = list(map(int, input().split()))

a = []

for i1 in range(n):
    for i2 in range(n):
        if i1 != i2:
            a.append(d[i1] * d[i2])

print((int(sum(a) / 2)))

# Optimized solution
n = int(eval(input()))
d = list(map(int, input().split()))

a = 0

for i in range(n):
    for j in range(i + 1, n):
        a = a + (d[i] * d[j])

print(a)
# Original solution
N = int(eval(input()))
d = list(map(int, input().split()))

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        ans += d[i] * d[j]

print(ans)


# Optimized solution
N = int(eval(input()))
d = list(map(int, input().split()))

D = sum(d)
ans = 0
for i in range(N):
    D -= d[i]
    ans += d[i] * D

print(ans)
# Original solution
import sys
import itertools


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    d = list(map(int, input().rstrip('\n').split()))
    t = 0
    for v in itertools.combinations(d, 2):
        t += (v[0] * v[1])
    print(t)


if __name__ == '__main__':
    solve()


# Optimized solution
import sys
import itertools


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    t = 0
    for v in itertools.combinations(a, 2):
        t += v[0] * v[1]
    print(t)


if __name__ == '__main__':
    solve()
# Original solution
import itertools

n = int(eval(input()))
d = list(map(int, input().split()))

c = list(itertools.combinations(d, 2))

ans = 0
for i in c:
    ans += i[0]*i[1]

print(ans)

# Optimized solution
n = int(eval(input()))
d = list(map(int, input().split()))
print((sum([d[i]*d[j]for i in range(n-1) for j in range(i+1, n)])))
# Original solution
N = int(eval(input()))
D = list(map(int, input().split()))

res = 0

for i in range(N):
    for j in range(i + 1, N):
        if i == j:
            continue
        res += D[i] * D[j]

print(res)


# Optimized solution
import itertools

N = int(eval(input()))
D = list(map(int, input().split()))

res = 0
for x, y in itertools.combinations(D, 2):
    res += x * y
print(res)
# Original solution
N = int(eval(input()))
D = list(map(int, input().split()))
from itertools import accumulate
print((sum(list(d*c for d, c in zip(D[1:], accumulate(D))))))


# Optimized solution
N = int(eval(input()))
D = list(map(int, input().split()))
from itertools import combinations
ans = 0
for i , j in combinations(D,2):
    ans += i*j
print(ans)
# Original solution
N = int(eval(input()))
D = list(map(int, input().split()))
from itertools import combinations
ans = 0
for i , j in combinations(D,2):
    ans += i*j
print(ans)

# Optimized solution
N=int(eval(input()))
D=list(map(int,input().split()))
print(((sum(D)**2-sum(d*d for d in D))//2))
# Original solution
n = int(eval(input()))
num = list(map(int,input().split()))
a = 0
b = 0
for i in range(n):
    for j in range(n):
        a = a + num[i] * num[j]

for i in range(n):
    b = b + num[i] * num[i]

print(((a - b) // 2))


# Optimized solution
n = int(eval(input()))
num = list(map(int,input().split()))
a = 0
for i in range(n):
    for j in range(i + 1,n):
        a += num[i] * num[j]

print(a)
# Original solution
import itertools
n=int(eval(input()))
d=list(map(int,input().split()))
sum=0
for v in itertools.combinations(d,2):
    sum+=v[0]*v[1]
print(sum)

# Optimized solution
n=int(eval(input()))
takoyaki=list(map(int,input().split()))
ans=0
while len(takoyaki)>1:
    s=takoyaki.pop()
    for x in takoyaki:
        ans+=s*x
        
print(ans)
# Original solution
import itertools
N = int(eval(input()))
D = list(input().split())
a = itertools.combinations(D,2)
sum= 0
for i,j in a:
    sum += eval("{} * {}".format(i,j))
print(sum)

# Optimized solution
N = int(eval(input()))
D = list(map(int,input().split()))
print(((sum(D)**2-sum(list([x**2 for x in D])))//2))
# Original solution
n=int(eval(input()))
listd=list(map(int,input().split()))
count=0
for i in range(1,n):
  for j in range(i+1,n+1):
    count+=listd[i-1]*listd[j-1]
print(count)

# Optimized solution
n=int(eval(input()))
l=list(map(int,input().split()))
ans=[]
for i in range(n-1):
  for j in range(i+1,n):
    a=l[i]*l[j]
    ans.append(a)
print((sum(ans)))
# Original solution
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():
    N, *D = list(map(int, read().split()))

    ans = 0
    for i in range(N):
        for j in range(i + 1, N):
            ans += D[i] * D[j]

    print(ans)
    return


if __name__ == '__main__':
    main()


# Optimized solution
import sys
from itertools import accumulate

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


def main():
    N, *D = list(map(int, read().split()))

    csum = accumulate(D)
    ans = sum(s * d for s, d in zip(csum, D[1:]))
    print(ans)
    return


if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
d = list(map(int, input().split()))
S = [d[0]]
for i in range(N-1):
  S.append(S[i] + d[i+1])
ans = 0
for j in range(N-1):
  ans += d[j+1] * S[j]
print(ans)

# Optimized solution
N = int(eval(input()))
d = list(map(int, input().split()))
S = [0]
for i in range(N):
  S.append(S[i] + d[i])
ans = 0
for j in range(N):
  ans += d[-j-1] * S[-j-2]
print(ans)
# Original solution
[ a, b ] = list(map ( int, input ( ).split ( ) ))
print(( "%s %s" % ( a * b, 2 * ( a + b ) ) ))

# Optimized solution
x = input().split()
a, b = int(x[0]), int(x[1])

print(("%d %d" % (a * b, 2 * (a + b))))
# Original solution
i = input()
a = i.split()

totalLength = 0
for length in a:
    totalLength += int(length) * 2

menseki = int(a[0])* int(a[1])

print(str(menseki)+" "+str(totalLength))

# Optimized solution
a,b = list(map(int,input().split()))
print(a*b,2*(a+b))
# Original solution
a, b=list(map(int,input().split()))
print(a*b, 2*a+2*b)

# Optimized solution
a, b = list(map(int, input().split()))
print(a*b, 2*(a+b))
# Original solution
import sys
from functools import reduce

for line in sys.stdin:
    nums = list([int(x) for x in line.split()])
    menseki = reduce(lambda x, y: x * y, nums)
    syuu = reduce(lambda x, y: x + y, nums) * 2
    print((str(menseki) + " " + str(syuu)))



# Optimized solution
import sys
import operator

for line in sys.stdin:
    nums = list(map(int, line.split()))
    strings = list(map(str, [operator.mul(*nums),
                        operator.add(*nums) * 2]))
    print((" ".join(strings)))
# Original solution
import sys

if __name__ == '__main__':
    import doctest
    doctest.testmod()
    a, b = list(map(int, sys.stdin.read().split()))
    print(a * b, 2 * (a + b))


# Optimized solution
#!/usr/bin/env python
#-*- coding: utf-8 -*-

# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_C

if __name__ == '__main__':
    a, b = list(map(int, input().split()))
    print(a * b, 2 * (a + b))
# Original solution
a = int(eval(input()))
_ = int(eval(input()))
_ = int(eval(input()))
_ = int(eval(input()))
e = int(eval(input()))
k = int(eval(input()))

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



# Optimized solution
a = int(eval(input()))
d = int(eval(input()))
f = int(eval(input()))
h = int(eval(input()))
e = int(eval(input()))
k = int(eval(input()))

if e - a <= k:
  print("Yay!")
else:
  print(":(")
# Original solution
import sys

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

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

gap = [abs(a-e),abs(b-e),abs(c-e),abs(d-e)]

for i in range(len(gap)):
	if gap[i] > k:
		print(':(')
		sys.exit()
print('Yay!')

# Optimized solution
import sys

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

gap = [abs(a-e),abs(b-e),abs(c-e),abs(d-e)]

for i in range(len(gap)):
	if gap[i] > k:
		print(':(')
		sys.exit()
print('Yay!')
# Original solution
anntena = [int(input()) for i in range(5)]
k = int(input())
 
print("Yay!") if anntena[4] - anntena[0] <= k else print(":(")


# Optimized solution
anntena = [int(input()) for i in range(5)]
k = int(input())

print(":(") if anntena[4] - anntena[0] > k else print("Yay!")
# Original solution
# coding: utf-8
# Your code here!
a=int(eval(input()))
b=int(eval(input()))
c=int(eval(input()))
d=int(eval(input()))
e=int(eval(input()))
k=int(eval(input()))
if e-a<=k:
    print("Yay!")
else:
    print(":(")

# Optimized solution
# coding: utf-8
a=int(eval(input()))
b=int(eval(input()))
c=int(eval(input()))
d=int(eval(input()))
e=int(eval(input()))
k=int(eval(input()))

if e-a>k:
    print(":(")
else:
    print("Yay!")
# Original solution
#!/usr/bin/env python3

import re

a = []
for i in range(6):
    b = int(eval(input()))
    a.append(b)

count = 0
for i in range(5):
    for j in range(i+1,5):
        if(a[j] - a[i] > a[5]):
            count += 1
        else:
            pass
if(count == 0):
    print("Yay!")
else:
    print(":(")


# Optimized solution
#!/usr/bin/env python3
#ABC123 A

LI = [int(eval(input())) for _ in range(6)]
K = LI[-1]

for i in range(1,5):
    for j in range(i):
        if LI[i] - LI[j] > K:
            print(':(')
            exit()
print('Yay!')
# Original solution
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
e = int(eval(input()))
k = int(eval(input()))
ant = [a, b, c, d, e]
f = False

for i in range(0, 5):
    for ii in range(i + 1, 5):
        sa = ant[i] - ant[ii]
        if -sa <= k:
            continue
        else:
            print(":(")
            f = True
            break
    break

if f is False:
    print("Yay!")


# Optimized solution
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
e = int(eval(input()))
k = int(eval(input()))

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

# Optimized solution
N = 5
a2e = [int(eval(input())) for _ in range(N)]
k = int(eval(input()))

for i in range(N):
    for j in range(N):
        if k < abs(a2e[i] - a2e[j]):
            print(':(')
            exit()

print('Yay!')
# Original solution
import itertools


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

combs = itertools.combinations([a, b, c, d, e], 2)

can_connects = [abs(x[0] - x[1]) <= k for x in combs]

if all(can_connects):
    print('Yay!')
else:
    print(':(')




# Optimized solution
import itertools


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

# a<b<c<d<e を利用
max_distance = e - a

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

# 全組み合わせの探索
# combs = itertools.combinations([a, b, c, d, e], 2)
# 
# can_connects = [abs(x[0] - x[1]) <= k for x in combs]
# 
# if all(can_connects):
#     print('Yay!')
# else:
#     print(':(')
# Original solution
a = [int(eval(input())) for _ in range(5)]
k = int(eval(input()))
if max(a)-min(a) > k:
    print(':(')
else:
    print('Yay!')

# Optimized solution
IN = [int(eval(input())) for _ in range(6)]

if IN[4] - IN[0] > IN[5]:
    print(':(')
else:
    print('Yay!')
# Original solution
v = []
e = ''
for i in range(6):
    v.append(int(eval(input())))

for i in range(len(v)) :
    for j in range(i+1, len(v)):
        if(abs(v[i] - v[j]) > v[-1]):
            e = ':('

if e != '':
    print(e)
else:
    print('Yay!')
        

# Optimized solution
a=int(eval(input()))
b=int(eval(input()))
c=int(eval(input()))
d=int(eval(input()))
e=int(eval(input()))
k=int(eval(input()))
sub=[]
sub.append(b-a)
sub.append(c-a)
sub.append(d-a)
sub.append(e-a)
sub.append(c-b)
sub.append(d-b)
sub.append(e-b)
sub.append(d-c)
sub.append(e-c)
sub.append(e-d)
max=max(sub)
if max<=k:
    print('Yay!')
else:
    print(':(')
# Original solution
a=int(eval(input()))
b=int(eval(input()))
c=int(eval(input()))
d=int(eval(input()))
e=int(eval(input()))
k=int(eval(input()))
print(("Yay!" if e-a<=k else ":("))

# Optimized solution
a = [int(eval(input())) for i in range(6)]
print(('Yay!' if a[4]-a[0] <= a[5] else ":("))
# Original solution
# -*- coding: utf-8 -*-
l = []

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

k = int(eval(input()))

a = []
for i in range(4):
    for j in range(i+1,5):
        ans = l[j]-l[i]
        a.append(ans)

b = 0

for i in range(10):
    if a[i]>k:
        b = 1
        break

if b == 1:
    print(':(')
elif b == 0:
    print('Yay!')

# Optimized solution
# -*- coding: utf-8 -*-

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

K = int(eval(input()))

if L[4]-L[0]<=K:
    ans = 'Yay!'
else:
    ans = ':('

print(ans)
# Original solution
antenna = [int(eval(input())) for i in range(5)]
k = int(eval(input()))
judge = ''
i,j = 1,1
for i in range(5):
  for j in range(i+1,5):
    if abs(antenna[i]-antenna[j]) > k:
      judge = ':('
      break

if judge==':(':
  print(':(')
else:
  print('Yay!')

# Optimized solution
antenna = []
for i in range(5):
  antenna.append(int(eval(input())))
K = int(eval(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!')
# Original solution
e = [int(eval(input())) for _ in range(5)]
k = int(eval(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 ':('))


# Optimized solution
v = [int(eval(input())) for _ in range(5)]
k = int(eval(input()))

bl = max(v) - min(v) <= k
print(('Yay!' if bl else ':('))
# Original solution
num_a = 5
antennas = [int(eval(input())) for _ in range(num_a)]
k = int(eval(input()))
exist = False
for q in range(num_a - 1, 0, -1):
    for p in range(q - 1, -1, -1):
        if antennas[q] - antennas[p] > k:
            exist = True
            break

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


# Optimized solution
N = 5
inputs = [int(eval(input())) for _ in range(N)]
k = int(eval(input()))
print((":(" if inputs[N-1] - inputs[0] > k else "Yay!"))
# Original solution
*A, k = [int(eval(input())) for _ in range(6)]

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

# Optimized solution
*A, k = [int(eval(input())) for _ in range(6)]
if abs(A[0] - A[-1]) > k:
    print(":(")
else:
    print("Yay!")
# Original solution
import itertools
import math
import fractions
import functools
import copy

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

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


# Optimized solution
def main():
    # n = int(input())
    # n, m = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in rane(n)]
    a = int(eval(input()))
    b = int(eval(input()))
    c = int(eval(input()))
    d = int(eval(input()))
    e = int(eval(input()))
    k = int(eval(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!")


if __name__ == '__main__':
    main()
# Original solution
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
e = int(eval(input()))
k = int(eval(input()))
li = [a, b, c, d, e]
for i in range(5):
    for j in range(5):
        if i == j:
            continue
        if abs(li[j] - li[i]) > k:
            print(":(")
            exit()
print("Yay!")


# Optimized solution
*a, k = list(map(int, open(0).read().split()))
for i in range(5):
    for j in range(5):
        if i == j:
            continue
        if abs(a[j] - a[i]) > k:
            print(":(")
            exit()
print("Yay!")
# Original solution
import sys

args = [int(eval(input())) for i in range(6)]


for arg1 in args[:5]:
    for arg2 in args[1:5]:
        if (arg2 - arg1) > args[5]:
            print(":(")
            sys.exit()
print("Yay!")

# Optimized solution
import sys

args = [int(eval(input())) for i in range(6)]

if (args[4] - args[0]) > args[5]:
    print(":(")
    sys.exit()
print("Yay!")