There are five people playing a game called "Generosity". Each person gives some non-zero number of coins b as an initial bet. After all players make their bets of b coins, the following operation is repeated for several times: a coin is passed from one player to some other player.

Your task is to write a program that can, given the number of coins each player has at the end of the game, determine the size b of the initial bet or find out that such outcome of the game cannot be obtained for any positive number of coins b in the initial bet.


-----Input-----

The input consists of a single line containing five integers c_1, c_2, c_3, c_4 and c_5 — the number of coins that the first, second, third, fourth and fifth players respectively have at the end of the game (0 ≤ c_1, c_2, c_3, c_4, c_5 ≤ 100).


-----Output-----

Print the only line containing a single positive integer b — the number of coins in the initial bet of each player. If there is no such value of b, then print the only value "-1" (quotes for clarity).


-----Examples-----
Input
2 5 4 0 4

Output
3

Input
4 5 9 2 1

Output
-1



-----Note-----

In the first sample the following sequence of operations is possible:  One coin is passed from the fourth player to the second player;  One coin is passed from the fourth player to the fifth player;  One coin is passed from the first player to the third player;  One coin is passed from the fourth player to the second player.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
raw = input()
raw = raw.split(' ')
raw = [int(x) for x in raw]
a = 0
for x in raw:
	a = a + x
if a == 0:
	print(-1)
elif a % 5 != 0:
	print(-1)
else:
	print(int(a / 5))


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def solve():
	a = list(map(int, input().split()))
	s = sum(a)
	ans = s / len(a)
	if math.ceil(ans) == math.floor(ans) and ans > 0:
		print(int(ans))
	else:
		print(-1)
for _ in range(1):
	solve()


d = [int(x) for x in input().split(' ')]
if sum(d) % 5 != 0 or sum(d) == 0:
	print(-1)
else:
	print(int(sum(d) / 5))


coin = [int(x) for x in input().split()]
if sum(coin) % 5 == 0 and sum(coin) != 0:
	print(sum(coin) // 5)
else:
	print(-1)


a_list = [int(x) for x in input().split()]
summ = 0
for i in a_list:
	summ += i
if summ % 5 == 0 and summ != 0:
	print(str(summ // 5))
else:
	print('-1')


import sys
input1 = list(map(int, sys.stdin.readline().split(' ')))
n = len(input1)
sum1 = sum(input1)
if sum1 % n == 0 and sum1 != 0:
	print(sum1 // n)
else:
	print(-1)


c = [int(i) for i in input().split()]
l = sum(c)
if l % 5 == 0 and l > 0:
	print(l // 5)
else:
	print(-1)


from sys import stdin
c = sum(map(int, stdin.readline().rstrip().split()))
if c == 0:
	print(-1)
else:
	print((-1, c // 5)[not c % 5])


inp = [int(x) for x in input().split()]
x = sum(inp)
if x == 0:
	print(-1)
elif x % 5 == 0:
	print(x // 5)
else:
	print(-1)


c = list(map(int, input().split()))
s = sum(c)
if s % 5 == 0 and s != 0:
	print(s // 5)
else:
	print(-1)


(a, b, c, d, e) = map(int, input().split())
m = a + b + c + d + e
if m % 5 != 0 or m == 0:
	print('-1')
else:
	print(m // 5)


a = [int(a) for a in input().split()]
if sum(a) % 5 != 0 or sum(a) / 5 == 0:
	print(-1)
	exit()
print(int(sum(a) / 5))


a = list(map(int, input().split()))
if sum(a) % 5 == 0 and sum(a) != 0:
	print(round(sum(a) / 5))
else:
	print('-1')


arr = list(map(int, input().split()))
p = sum(arr)
if not p:
	print(-1)
elif not p % 5:
	print(int(p / 5))
else:
	print(-1)


n = list(map(int, input().rstrip().split()))
nn1 = sum(n)
if nn1 % 5 == 0 and nn1 > 0:
	print(int(nn1 / 5))
else:
	print(-1)


c = sum([int(i) for i in input().split()])
if c % 5:
	print(-1)
elif c // 5:
	print(c // 5)
else:
	print(-1)


from functools import reduce
groups = [int(a) for a in input().split(' ')]
sum = reduce(lambda x, y: x + y, groups)
if sum % 5 == 0 and sum != 0:
	print(sum // 5)
else:
	print(-1)


l = list(map(int, input().split()))
if sum(l) % 5 == 0 and sum(l) != 0:
	print(sum(l) // 5)
else:
	print(-1)


a = input().split()
s = int(a[0]) + int(a[1]) + int(a[2]) + int(a[3]) + int(a[4])
if s != 0 and s % 5 == 0:
	print(s // 5)
else:
	print(-1)


arr = [0] * 99
arr = list(map(int, input().split()))
a = arr[0]
b = arr[1]
c = arr[2]
d = arr[3]
e = arr[4]
s = a + b + c + d + e
if s > 0 and s % 5 == 0:
	print(int(s / 5))
else:
	print(-1)


arr = list(map(int, input().split()))
if sum(arr) == 0:
	print(-1)
elif sum(arr) % 5 == 0:
	print(sum(arr) // 5)
else:
	print(-1)


import math
l = list(map(int, input().split()))
if sum(l) != 0:
	print(sum(l) // 5 if (sum(l) / 5).is_integer() == 1 else -1)
else:
	print(-1)


lis = [int(a) for a in input().split()]
s = sum(lis)
l = len(lis)
if s == 0:
	print(-1)
elif s % l == 0:
	print(s // l)
else:
	print(-1)


l = list(map(int, input().split()))
s = sum(l)
if s == 0:
	print(-1)
elif s % 5 != 0:
	print(-1)
else:
	print(s // 5)


__author__ = 'hamed1soleimani'
ipt = input().split()
s = 0
for i in range(len(ipt)):
	ipt[i] = int(ipt[i])
	s += ipt[i]
if s < 5:
	print(-1)
elif s % 5 == 0:
	print(s // 5)
else:
	print(-1)


import math
sm = sum(list(map(int, input().split())))
if sm % 5 == 0 and sm // 5 != 0:
	print(sm // 5)
else:
	print(-1)


a = input().split()
b = 0
for i in a:
	b += int(i)
if b != 0 and b % 5 == 0:
	print(int(b / 5))
else:
	print('-1')


a = [int(x) for x in input().split()]
c = 0
for i in range(len(a)):
	c += a[i]
if c % len(a) == 0 and c != 0:
	print(int(c / len(a)))
else:
	print('-1')


ls = list(map(int, input().split()))
s = sum(ls)
print([s // 5, -1][s % 5 != 0 or not s])


(a, b, c, d, e) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = int(e)
if (a + b + c + d + e) % 5 == 0 and a + b + c + d + e != 0:
	print(int((a + b + c + d + e) / 5))
else:
	print('-1')


(a, b, c, d, e) = map(int, input().split())
sum = float((a + b + c + d + e) / 5.0)
x = int(sum)
if sum - x == 0 and sum != 0:
	print('%i' % sum)
else:
	print('-1')


def main():
	from sys import stdin, stdout
	k = sum(map(int, stdin.readline().split()))
	if k % 5:
		stdout.write('-1')
	elif k // 5:
		stdout.write(str(k // 5))
	else:
		stdout.write('-1')
main()


def solve(arr):
	sum_arr = sum(arr)
	return sum_arr % len(arr) == 0 and sum_arr // len(arr) or -1
(a, b, c, d, e) = map(int, input().split())
print(solve([a, b, c, d, e]))


cois = [int(i) for i in input().split()]
if sum(cois) > 0 and sum(cois) % 5 == 0:
	print(int(sum(cois) / 5))
else:
	print('-1')


m = list(input().split())
for i in range(len(m)):
	m[i] = int(m[i])
if sum(m) % 5 == 0 and sum(m) > 0:
	print(int(sum(m) / 5))
else:
	print(-1)


a = sum(map(int, input().split()))
if (a == 0) | a % 5:
	print(-1)
else:
	print(a // 5)


t = list(map(int, input().split()))
p = sum(t)
if p % 5 == 0 and p > 0:
	print(p // 5)
else:
	print(-1)


coins = sum([int(x) for x in input().split(' ')]) / 5
if not float(coins).is_integer() or coins == 0:
	print(-1)
else:
	print(int(coins))


from functools import reduce
value = [int(m) for m in input().split()]
value = reduce(lambda x, y: x + y, value)
print(value // 5 if value > 0 and value % 5 == 0 else -1)


pet = [int(z) for z in input().split()]
x = sum(pet) % pet.__len__()
if x == 0 and sum(pet) != 0:
	print(sum(pet) // pet.__len__())
else:
	print('-1')


arr = [int(x) for x in input().split()]
s = sum(arr)
if s == 0:
	print('-1')
elif s % 5 == 0:
	print(s // 5)
else:
	print('-1')


c = list(map(int, input().strip().split(' ')))
if sum(c) == 0:
	print(-1)
else:
	md = sum(c) % 5
	dv = sum(c) // 5
	if md == 0:
		s = 0
		for i in range(5):
			s += c[i] - dv
		if s == 0:
			print(dv)
		else:
			print(-1)
	else:
		print(-1)


elements = list(map(int, input().split(' ')))
total = sum(elements)
if total == 0:
	print(-1)
elif total % len(elements) == 0:
	print(total // len(elements))
else:
	print(-1)


s = [int(a) for a in input().split()]
if sum(s) < 5:
	print(-1)
elif sum(s) % 5 == 0:
	print(int(sum(s) / 5))
else:
	print(-1)


from sys import *
coins = [int(x) for x in stdin.read().rstrip().split()]
sum_coins = sum(coins)
print('{}\n'.format(sum_coins // 5 if sum_coins % 5 == 0 and sum_coins != 0 else -1))


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

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

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

def main():
	arr = array()
	if sum(arr) > 0 and sum(arr) % 5 == 0:
		print(sum(arr) // 5)
	else:
		print(-1)
t = 1
for _ in range(t):
	main()


a = list(map(int, input().split()))
s = sum(a)
if s == 0 or s // 5 != s / 5:
	print(-1)
else:
	print(s // 5)


s = 0
a = []
a = list(map(int, input().split()))
for i in range(5):
	s = s + a[i]
if s % 5 == 0 and s != 0:
	print(s // 5)
else:
	print('-1')


import sys
coins = [int(x) for x in input().split()]
s = sum(coins)
if s % len(coins) == 0 and s != 0:
	print(int(s / len(coins)))
else:
	print(str(-1))


s = input().split(' ')
n1 = int(s[0])
n2 = int(s[1])
n3 = int(s[2])
n4 = int(s[3])
n5 = int(s[4])
if (n1 + n2 + n3 + n4 + n5) % 5 == 0 and n1 + n2 + n3 + n4 + n5 != 0:
	print((n1 + n2 + n3 + n4 + n5) // 5)
else:
	print(-1)


c = list(map(int, input().split()))
s = sum(c)
l = len(c)
if s % l == 0 and s > 0:
	print(s // l)
else:
	print(-1)


c = [int(i) for i in input().split()]
if sum(c) == 0 or sum(c) % 5 != 0:
	print('-1')
else:
	print(sum(c) // 5)


arr = sum(list(map(int, input().split(' '))))
if arr == 0:
	print(-1)
	exit()
print([-1, arr // 5][arr % 5 == 0])


from sys import stdin
x = stdin.readline().split()
res = 0
for i in range(len(x)):
	x[i] = int(x[i])
for i in range(len(x)):
	res = res + x[i]
if res == 0:
	print(-1)
elif res % len(x) == 0:
	print(res // len(x))
else:
	print(-1)


def first_st(lst):
	if sum(lst) == 0:
		return -1
	elif sum(lst) % 5 == 0:
		return sum(lst) // 5
	return -1
a = [int(i) for i in input().split()]
print(first_st(a))


def main():
	a = sum(read())
	if a == 0 or a % 5:
		print(-1)
	else:
		print(a // 5)

def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return list(map(int, inputs.split()))

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='')
write(main())


__author__ = 'Utena'
m = list(map(int, input().split()))
v = sum(m)
if v % 5 == 0 and v != 0:
	print(v // 5)
else:
	print(-1)


total = sum(map(int, input().split()))
if total % 5 or total == 0:
	print(-1)
else:
	print(total // 5)


(q, w, e, r, t) = [int(i) for i in input().split()]
if (q + w + e + r + t) % 5 == 0 and (q + w + e + r + t) / 5 > 0:
	print(int((q + w + e + r + t) / 5))
else:
	print('-1')


def coins():
	coins = [int(i) for i in input().split()]
	su = sum(coins)
	if su == 0:
		return '-1'
	(div, mod) = divmod(su, 5)
	if mod == 0:
		return str(int(div))
	else:
		return '-1'
print(coins())


l = list(map(int, input().split()))
print([sum(l) // len(l), -1][sum(l) // len(l) != sum(l) / len(l) or sum(l) == 0])


n = list(map(int, input().split()))
s = sum(n)
r = s % 5
if r == 0 and s:
	print(s // 5)
else:
	print(-1)


a = sum(map(int, input().split()))
print([a // 5, -1][a % 5 != 0 or a == 0])


l = list(map(int, input().split()))
e = sum(l)
if e % 5 != 0 or e == 0:
	print(-1)
else:
	print(e // 5)


(a, s, d, f, g) = [int(x) for x in input().split()]
if (a + s + d + f + g) % 5 == 0 and (a + s + d + f + g) // 5 != 0:
	print((a + s + d + f + g) // 5)
else:
	print(-1)


c = [int(x) for x in input().split()]
a = sum(c)
b = len(c)
if a != 0 and a % b == 0:
	print(int(a / b))
else:
	print(-1)


Y = lambda : list(map(int, input().split()))
a = Y()
print(-1 if not sum(a) or sum(a) % 5 else sum(a) // 5)


c = [int(x) for x in input().split(' ')]
if sum(c) % len(c) == 0 and sum(c) > 0:
	ans = sum(c) // len(c)
else:
	ans = -1
print(ans)


cStr = input()
cList = cStr.split()
total = 0
for i in range(5):
	total = total + int(cList[i])
if total % 5 == 0 and total != 0:
	print(total // 5)
else:
	print(-1)


initial = sum(list(map(int, input().split()))) / 5
print(int(initial)) if initial.is_integer() and initial > 0 else print(-1)


(*l,) = map(int, input().split())
print(sum(l) // 5) if not sum(l) % 5 and sum(l) else print(-1)


def inp(s):
	j = 0
	a = []
	for i in range(len(s)):
		if s[i] == ' ':
			a.append(int(s[j:i]))
			j = i + 1
		if i == len(s) - 1:
			a.append(int(s[j:]))
	return a
s = input()
a = inp(s)
r = 0
for i in a:
	r = r + i
if r == 0:
	print(-1)
elif r % 5 == 0:
	print(int(r / 5))
else:
	print(-1)


a = list(map(int, input().split()))
sm = sum(a)
if sm == 0:
	print(-1)
elif sm % 5 == 0:
	print(sm // 5)
else:
	print(-1)


__author__ = 'runekri3'
coins = list(map(int, input().split()))
coins_sum = sum(coins)
if coins_sum % 5 == 0 and coins_sum > 0:
	print(coins_sum // 5)
else:
	print(-1)


z = list(map(int, input().split()))
print(['-1', '%d' % (sum(z) // 5)][sum(z) % 5 == 0 and sum(z) != 0])


import functools
import operator
data = list(map(int, input().split()))
sum = functools.reduce(operator.add, data)
if not sum % 5:
	if sum // 5 > 0:
		print(sum // 5)
	else:
		print(-1)
else:
	print(-1)


lista = list(map(int, input().split()))
mayor = max(lista)
bolsa = 0
find = False
val = 0
lista.sort()
for i in range(1, mayor + 1):
	bolsa = 0
	for j in range(5):
		if i > lista[j]:
			bolsa -= i - lista[j]
		elif i < lista[j]:
			bolsa += lista[j] - i
	if bolsa == 0:
		val = i
		find = True
		break
	if find:
		break
if find:
	print(i)
else:
	print('-1')


l = [int(x) for x in input().split()]
s = sum(l)
n = len(l)
if s % n == 0 and s != 0:
	print(s // n)
else:
	print(-1)


c = list(map(int, input().split()))
if sum(c) % 5 != 0 or sum(c) == 0:
	print(-1)
else:
	print(sum(c) // 5)


s = sum(list(map(int, input().split())))

def ans():
	for i in range(1, 101):
		if 5 * i == s:
			return i
	return -1
print(ans())


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7

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

def I():
	return int(input())

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

def S():
	return input()

def main():
	l = LI()
	if sum(l) % 5 != 0 or sum(l) == 0:
		return -1
	return sum(l) // 5
print(main())


a = list(map(int, input().split()))
sum_a = 0
for i in range(len(a)):
	sum_a += a[i]
if sum_a % 5 == 0:
	if sum_a != 0:
		print(sum_a // 5)
	else:
		print('-1')
else:
	print('-1')


lis = list(map(int, input().split()))
su = sum(lis)
if su == 0 or su % 5 != 0:
	print(-1)
else:
	print(su // 5)


(c1, c2, c3, c4, c5) = map(int, input().split())
if (c1 + c2 + c3 + c4 + c5) % 5 == 0 and c1 + c2 + c3 + c4 + c5 != 0:
	print((c1 + c2 + c3 + c4 + c5) // 5)
else:
	print(-1)


l = input().split()
s = 0
for i in l:
	s += int(i)
if s % 5 != 0 or s == 0:
	print(-1)
else:
	print(s // 5)


x = list(map(int, input().split()))
y = sum(x)
z = y / len(x) if y > 0 and y % 5 == 0 else -1
print(int(z))


a = sum([int(i) for i in input().split(' ')])
print(a // 5 if a % 5 == 0 and (not a == 0) else -1)


(c1, c2, c3, c4, c5) = [int(i) for i in input().split()]
s = c1 + c2 + c3 + c4 + c5
if s == 0:
	print(-1)
elif s % 5 == 0:
	print(s // 5)
else:
	print(-1)


a = list(map(int, input().split()))
if sum(a) / len(a) == sum(a) // len(a) and sum(a) is not 0:
	print(sum(a) // len(a))
else:
	print(-1)


(c1, c2, c3, c4, c5) = map(int, input().split())
b = c1 + c2 + c3 + c4 + c5
if b % 5 != 0 or b == 0:
	print(-1)
else:
	print(int(b / 5))


a = list(map(int, input().split()))
if len(set(a)) == 1 and a[0] == 0:
	print(-1)
elif sum(a) // 5 == sum(a) / 5:
	print(sum(a) // 5)
else:
	print(-1)


cn = sum(map(int, input().split()))
print(cn // 5 if cn % 5 == 0 and cn > 0 else '-1')


A = [int(x) for x in input().split()]
soma = sum(A)
if soma % 5 == 0 and soma != 0:
	print(soma // 5)
else:
	print(-1)


lis = list(map(int, input().split()))
s = sum(lis)
if s % len(lis) == 0 and s != 0:
	print(int(s / len(lis)))
else:
	print(-1)


n = list(map(int, input().split()))
i = 0
s = 0
while i < 5:
	s += n[i]
	i += 1
if s % 5 == 0 and s != 0:
	print(s // 5)
else:
	print(-1)


inp = list(map(int, input().split()))
x = sum(inp)
if x == 0:
	print('-1')
elif x % 5 == 0:
	print(int(x / 5))
else:
	print('-1')


def find_init_bet(d):
	if sum(d) % 5 or sum(d) == 0:
		return -1
	return sum(d) // 5

def main():
	dist = list(map(int, input().split()))
	print(find_init_bet(dist))
main()


(a, b, c, d, e) = [int(x) for x in input().split()]
s = a + b + c + d + e
if s == 0:
	print(-1)
elif s % 5 == 0:
	print(s // 5)
else:
	print(-1)


a = input().split()
b = []
for n in a:
	b.append(int(n))
if sum(b) % len(b) == 0 and sum(b) != 0:
	print(int(sum(b) / len(b)))
else:
	print('-1')


C = input().rstrip().split(' ')
p = list(C)
S = 0
for i in range(0, len(p)):
	S += int(p[i])
G = 0
for i in range(1, 101):
	if i * 5 == S:
		G = 1
		V = i
		break
if G == 0:
	print(-1)
else:
	print(V)


from sys import stdin

def main():
	num = [int(x) for x in stdin.readline().strip().split()]
	s = sum(num)
	if s > 0 and s % len(num) == 0:
		print(s // len(num))
	else:
		print(-1)
main()


a = list(map(int, input().rstrip().split()))
m = sum(a) // len(a)
if sum(a) % 5 != 0 or sum(a) == 0:
	print('-1')
else:
	print(m)


m = list(map(int, input().split()))
s = sum(m)
if not s % 5 and s:
	print(s // 5)
else:
	print(-1)


l = list(map(int, input().split()))
if l == [0, 0, 0, 0, 0]:
	print('-1')
	exit(0)
for i in range(max(l) + 1):
	s = 0
	for j in l:
		s += j - i
	if s == 0:
		print(i)
		exit(0)
print('-1')


def main():
	(a, b, c, d, e) = input().split()
	(a, b, c, d, e) = (int(a), int(b), int(c), int(d), int(e))
	sum = a + b + c + d + e
	if sum == 0:
		print(-1)
		return ()
	if sum % 5 == 0:
		print(int(sum / 5))
	else:
		print(-1)
	return ()
main()


ins = input().strip().split(' ')
bets = [int(i) for i in ins]
s = sum(bets)
if s == 0:
	print(-1)
elif s % 5 == 0:
	print(int(s / 5))
else:
	print(-1)


num = input()
arr = []
count = 0
for i in range(0, len(num)):
	if num[i] == ' ':
		arr.append(int(num[count:i]))
		count = i + 1
	elif i == len(num) - 1:
		arr.append(int(num[count:len(num)]))
counting = 0
for i in arr:
	counting += i
if counting % len(arr) == 0 and counting != 0:
	print(int(counting / len(arr)))
else:
	print(-1)


n = list(map(int, input().split()))
sum = 0
for i in range(len(n)):
	sum = sum + n[i]
if sum % len(n) == 0 and sum != 0:
	print(sum // len(n))
else:
	print('-1')


f = [int(s) for s in input().split()]
c = 0
for i in f:
	c += i
print(-1) if c % len(f) or not c else print(int(c / len(f)))


l = [int(x) for x in input().split()]
s = sum(l)
d = s / 5
if s == 0:
	print('-1')
elif d - s // 5 > 0:
	print('-1')
else:
	print(int(d))


a = list(map(int, input().split()))
if sum(a) == 0:
	print(-1)
elif sum(a) % len(a) == 0:
	print(sum(a) // len(a))
else:
	print(-1)


a = input().split()
z = int(a[0]) + int(a[1]) + int(a[2]) + int(a[3]) + int(a[4])
if z % 5 > 0 or z == 0:
	print(-1)
else:
	print(z // 5)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

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

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	a = LI()
	s = sum(a)
	if s % 5 > 0 or s == 0:
		return -1
	return s // 5
print(main())


coins = [int(a) for a in input().strip().split()]
if sum(coins) == 0:
	print(-1)
else:
	ave = sum(coins) / len(coins)
	if ave % 1 == 0:
		print(int(ave))
	else:
		print(-1)


n = input().split(' ')
if int((int(n[0]) + int(n[1]) + int(n[2]) + int(n[3]) + int(n[4])) / 5) == 0:
	print(-1)
elif (int(n[0]) + int(n[1]) + int(n[2]) + int(n[3]) + int(n[4])) % 5 == 0:
	print(int((int(n[0]) + int(n[1]) + int(n[2]) + int(n[3]) + int(n[4])) / 5))
else:
	print(-1)


inp = list(map(int, input().split()))
print(int(sum(inp) / len(inp)) if sum(inp) % len(inp) == 0 and sum(inp) > 0 else '-1')


l = [int(i) for i in input().split()]
s = sum(l)
if set(l) == {0}:
	print(-1)
elif s % 5 == 0:
	print(s // 5)
else:
	print(-1)


d = [int(i) for i in input().split()]
t = sum(d)
if t > 0 and t % len(d) == 0:
	print(t // len(d))
else:
	print(-1)


a = list(map(int, input().split(' ')))
suma = sum(a)
n = 5
if suma % 5 == 0 and suma != 0:
	print(suma // n)
else:
	print(-1)


(p1, p2, p3, p4, p5) = map(int, input().split())
n = p1 + p2 + p3 + p4 + p5
if n > 0 and n % 5 == 0:
	print(n // 5)
else:
	print(-1)


(a, b, c, d, e) = map(int, input().split())
s = a + b + c + d + e
if s == 0 or s % 5:
	print(-1)
elif s % 5 == 0:
	print(s // 5)


arr = input().split(' ')
n = len(arr)
arr = list(map(lambda x: int(x), arr))
if sum(arr) % n == 0 and sum(arr) > 0:
	print(sum(arr) // n)
else:
	print(-1)


import math
import os
import sys
import re
import itertools
import functools
import operator
x = sum(map(int, input().split()))
print(x // 5 if x % 5 == 0 and x != 0 else -1)


array = list(map(int, input().split(' ')))
l = len(array)
s = sum(array)
if s == 0:
	print(-1)
elif s % l == 0:
	print(s // l)
else:
	print(-1)


str_0 = input()
list_0 = str_0.split()
n = 0
for i in list_0:
	n += int(i)
if n % 5 != 0 or n == 0:
	print(-1)
else:
	print(int(n / 5))


s = [int(x) for x in input().split()]
print([-1, sum(s) // 5][sum(s) % 5 == 0 and sum(s) > 0])


row = list(map(float, input().split()))
if sum(row) % 5 == 0:
	if int(sum(row) / 5) > 0:
		print(int(sum(row) / 5))
	else:
		print('-1')
else:
	print('-1')


k = [int(i) for i in input().split()]
s = int(sum(k) / 5)
if s == sum(k) / 5 and s != 0:
	print(s)
else:
	print(-1)


import math
from decimal import Decimal

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
(a, b, c, d, e) = map(int, input().split())
s = a + b + c + d + e
if s % 5 == 0 and s >= 5:
	print(s // 5)
else:
	print(-1)


pl = list(map(int, input().split()))
res = sum(pl)
if res % 5 == 0 and res != 0:
	print(res // 5)
else:
	print(-1)


n = sum(list(map(int, input().split())))
k = n // 5 if n % 5 == 0 else -1
print(k if k > 0 else -1)


(c1, c2, c3, c4, c5) = map(int, input().split())
good = False
for b in range(1, 101):
	diff = c1 - b + c2 - b + c3 - b + c4 - b + c5 - b
	if diff == 0:
		good = True
		break
print(b if good else -1)


(a1, a2, a3, a4, a5) = map(int, input().split(' '))
temp = a1 + a2 + a3 + a4 + a5
if temp % 5 == 0 and temp != 0:
	print(temp // 5)
else:
	print('-1')


a = [int(a) for a in input().strip().split()]
sum = int()
for i in range(5):
	sum += a[i]
if sum % 5 == 0 and sum > 0:
	print(sum // 5)
else:
	print(-1)


bets = [int(i) for i in input().split()]
if bets == [0] * 5:
	print(-1)
else:
	initial_bet = sum(bets) / 5
	print(int(initial_bet) if initial_bet == int(initial_bet) else -1)


x = sum(map(int, str.split(input())))
if x > 0 and x % 5 == 0:
	print(x // 5)
else:
	print(-1)


a = list(map(int, input().strip().split(' ')))
c = 0
for i in a:
	c += i
if c % 5 == 0 and c != 0:
	print(int(c / 5))
else:
	print('-1')


coins = [int(x) for x in input().split()]
total = 0
for x in coins:
	total += x
b = int(total / len(coins))
if b * len(coins) == total and b != 0:
	print(b)
else:
	print(-1)


coins = input()
coins = coins.split()
coins = map(int, coins)
initial = 0
for num in coins:
	initial += num
initial = initial / 5
if initial.is_integer():
	if int(initial) == 0:
		print(-1)
	else:
		print(int(initial))
else:
	print(-1)


from sys import stdin
arr = list(map(int, stdin.readline().split()))
if sum(arr) % 5 == 0 and sum(arr) != 0:
	print(sum(arr) // 5)
else:
	print(-1)


total = sum(map(int, input().split()))
print([total // 5, -1][bool(total % 5) or not total])


(c1, c2, c3, c4, c5) = input().split()
c1 = int(c1)
c2 = int(c2)
c3 = int(c3)
c4 = int(c4)
c5 = int(c5)
s = c1 + c2 + c3 + c4 + c5
d = int(s / 5)
if s == 0:
	print('-1')
elif s % 5 is 0:
	print(d)
else:
	print('-1')


def fun():
	a = [int(i) for i in input().split()]
	if a.count(0) == 5:
		return -1
	if sum(a) % 5 == 0:
		return sum(a) / 5
	else:
		return -1
print(int(fun()))


from math import ceil

def main():
	n = list(map(int, input().split()))
	s = sum(n)
	if s % len(n) or s == 0:
		print('-1')
	else:
		print(s // len(n))
main()


l = list(map(int, input().split()))
k = len(l)
s = sum(l)
if s % k != 0 or s == 0:
	print('-1')
else:
	print(int(s / k))


c = list(map(int, input().split()))
x = len(c)
y = sum(c)
if y % x == 0 and y != 0:
	print(y // x)
else:
	print(-1)


def check(num):
	if num % 1 == 0:
		return True
	else:
		return False
mylist = list(map(int, input().split()))
summ = sum(mylist)
if summ == 0:
	print('-1')
else:
	x = summ / 5
	if check(x):
		print(int(x))
	else:
		print('-1')


sum = sum([int(next) for next in input().split()])
print(sum // 5) if sum % 5 == 0 and sum > 0 else print(-1)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
arr = l()
if sum(arr) % 5 == 0 and sum(arr) > 0:
	out(sum(arr) // 5)
	exit()
out(-1)


c = [int(i) for i in input().split()]
k = 0
for i in range(5):
	k += c[i]
if k % 5:
	print(-1)
elif k == 0:
	print(-1)
else:
	print(round(k / 5))


n = input()
sum = 0
coins = n.split()
p = len(coins)
for coin in coins:
	sum += int(coin)
if sum % p == 0 and sum != 0:
	print(int(sum / p))
else:
	print(-1)


x = input().split()
d1 = int(x[0])
d2 = int(x[1])
d3 = int(x[2])
d4 = int(x[3])
d5 = int(x[4])
s = d1 + d2 + d3 + d4 + d5
if s == 0:
	print(-1)
elif s % 5 == 0:
	print(s // 5)
else:
	print(-1)


c = list(map(int, input().split()))
sc = sum((i for i in c))
print([-1, sc // 5][sc % 5 == 0 and sc != 0])


__author__ = 'myduomilia'
a = sum(map(int, input().split()))
if a % 5 == 0 and a != 0:
	print(a // 5)
else:
	print(-1)


mas = [int(i) for i in input().split()]
if sum(mas) > 0 and sum(mas) % len(mas) == 0:
	print(sum(mas) // len(mas))
else:
	print(-1)


s = input().split()
res = 0
for i in range(5):
	res += int(s[i])
if res % 5 == 0:
	if res / 5 != 0:
		print(int(res / 5))
	else:
		print(-1)
else:
	print(-1)


def solve(num):
	n = len(num)
	sum = 0
	for num in nums:
		sum += num
	return -1 if sum == 0 or sum % n != 0 else int(sum / n)
nums = list(map(int, input().split(' ')))
print(solve(nums))


l = list(map(int, input().split()))
t = sum(l) / len(l)
if t - int(t) == 0 and sum(l) != 0:
	print(int(t))
else:
	print(-1)


bet = input()
bet = bet.split()
sum = int(bet[0]) + int(bet[1]) + int(bet[2]) + int(bet[3]) + int(bet[4])
if sum // 5 == 0:
	print(-1)
elif sum / 5 == sum // 5:
	print(sum // 5)
else:
	print(-1)


a = list(map(int, input().split()))
s = 0
for x in a:
	s += x
if s % 5 == 0 and s != 0:
	print(int(s / 5))
else:
	print(-1)


b = list(map(int, input().split()))
d = sum(b)
if d % 5 == 0 and d // 5 > 0:
	print(d // 5)
else:
	print(-1)


c = [int(x) for x in input().split()]
s = sum(c)
if s % 5 == 0 and s != 0:
	print(int(s / 5))
else:
	print(-1)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))
a = sum(inl())
n = a / 5
print(int(n) if n.is_integer() and n != 0 else -1)


temp = map(int, input().split(' '))
(a1, a2, a3, a4, a5) = temp
t = a1 + a2 + a3 + a4 + a5
if t % 5 != 0:
	print(-1)
elif t == 0:
	print('-1')
else:
	print(int(t / 5))


s = [int(i) for i in input().split()]
a = sum(s)
if a % 5 != 0 or not a:
	print(-1)
else:
	print(a // 5)


from sys import stdin
__author__ = 'artyom'
s = sum(map(int, stdin.readline().strip().split()))
r = s // 5
print((r if r > 0 else -1) if s % 5 == 0 else -1)


c = [int(x) for x in input().split()]
if sum(c) % 5 != 0 or sum(c) == 0:
	print('-1')
else:
	b = sum(c) // 5
	print(b)


s = input()
t = 0
i = 0
while i < len(s):
	for j in range(i, len(s)):
		if s[j] == ' ':
			break
	t += int(s[i:j + 1].rstrip())
	i = j + 1
if not t % 5 == 0 or t == 0:
	m = -1
else:
	m = int(t / 5)
print(m)


valores = input().split(' ')
soma = 0
for i in range(5):
	valores[i] = int(valores[i])
for i in range(5):
	soma = soma + valores[i]
if soma % 5 == 0 and soma != 0:
	print('%i' % (soma / 5))
else:
	print('-1')


list1 = list(map(int, input().split(' ')))
if not sum(list1) % 5:
	if list1.count(0) == len(list1):
		print(-1)
	else:
		print(sum(list1) // 5)
else:
	print(-1)


from sys import stdin

def main():
	a = stdin.readline().strip()
	b = a.split()
	cont = 0
	for i in range(0, len(b)):
		c = int(b[i])
		cont = cont + c
	if cont != 0 and cont % 5 == 0:
		print(cont // 5)
	else:
		print('-1')
main()


moneys = [int(x) for x in input().split()]
m = 0
for money in moneys:
	m += money
if m == 0 or m % 5 != 0:
	print('-1')
else:
	print(int(m / 5))


import string
import math
x = 0
s = input().split(' ')
for i in range(5):
	x = int(s[i]) + x
if x % 5 == 0 and x != 0:
	print(int(x / 5))
else:
	print(-1)


x = input().split()
stacks = [int(i) for i in x]
if sum(stacks) % 5 != 0 or sum(stacks) == 0:
	print(-1)
else:
	print(int(sum(stacks) / 5))


from typing import List

def parse_input() -> List[int]:
	return [int(x) for x in input().split()]

def solve(c: List[int]) -> int:
	if sum(c) % 5 == 0 and sum(c) != 0:
		return sum(c) // 5
	else:
		return -1
print(solve(parse_input()))


def main():
	coins = [int(elem) for elem in input().split()]
	total = sum(coins)
	if total == 0:
		print(-1)
	elif not total % 5:
		print(total // 5)
	else:
		print(-1)
main()


def main():
	n = list(map(int, input().split()))
	i = 0
	s = 0
	for i in range(5):
		s = s + n[i]
		i = i + 1
	if s > 0:
		if s % 5 == 0:
			print(int(s / 5))
		else:
			print(-1)
	else:
		print(-1)
main()


C = [int(s) for s in input().split()]
if sum(C) % 5 == 0 and sum(C) != 0:
	print(sum(C) // 5)
else:
	print(-1)


soma = sum([int(i) for i in input().split()])
if soma == 0:
	print(-1)
else:
	print(-1 if soma % 5 != 0 else soma // 5)


arr = list(map(int, input().split()))
a = 0
for i in arr:
	a = a + i
if a == 0:
	print(-1)
	exit()
if a % 5 == 0:
	print(a // 5)
else:
	print(-1)


sum = 0
(a, b, c, d, e) = map(int, input().split())
sum = a + b + c + d + e
if sum == 0:
	print(-1)
elif sum % 5 != 0:
	print(-1)
else:
	print(int(sum / 5))


(a, b, c, d, e) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = int(e)
f = a + b + c + d + e
if f % 5 != 0 or f == 0:
	print('-1')
else:
	print(int(f / 5))


str = input()
sum = 0
sum1 = 0
list1 = list(str.split())
for i in range(0, 5):
	sum += int(list1[i])
val1 = int(sum / 5)
for i in range(0, 5):
	if int(list1[i]) > val1:
		sum1 += int(list1[i]) - val1
	else:
		sum1 -= val1 - int(list1[i])
if sum1 == 0 and val1 != 0:
	print(int(val1))
else:
	print(-1)


a = list(map(int, input().split()))
l = len(a)
s = sum(a)
p = s / l
q = s // l
if p == q and p != 0:
	print(q)
else:
	print('-1')


c = [int(i) for i in input().split()]
print([-1, sum(c) // len(c)][sum(c) % len(c) == 0 and sum(c) != 0])


a = map(int, input().split())
sum = 0
for i in a:
	sum += i
if sum == 0:
	print(-1)
elif sum % 5 == 0:
	print(sum // 5)
else:
	print(-1)


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return (self.nextint() for i in range(n))

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
c = sum(nextints())
if c % 5 == 0 and c > 0:
	print(c // 5)
else:
	print('-1')


l = input().split()
su = 0
for i in range(5):
	su += int(l[i])
if su != 0 and su % 5 == 0:
	print(su // 5)
else:
	print('-1')


def initial_bet(a):
	if sum(a) == 0:
		print(-1)
		return
	p = sum(a) / len(a)
	if p.is_integer():
		print(int(p))
	else:
		print(-1)
a = list(map(int, input('').split()))
initial_bet(a)


string = input().split()
a = int(string[0])
b = int(string[1])
c = int(string[2])
d = int(string[3])
e = int(string[4])
res = -1
i = 1
if (a + b + c + d + e) % 5 == 0:
	res = (a + b + c + d + e) // 5
else:
	res = -1
if res == 0:
	res = -1
print(res)


import sys
alist = list(map(int, sys.stdin.readline().split()))
salist = sum(alist)
if salist % 5 == 0 and salist > 0:
	print(salist // 5)
else:
	print(-1)


d = divmod(sum(map(int, input().split())), 5)
print(-1 if d[1] or not d[0] else d[0])


line = [int(i) for i in input().split(' ')]
total = sum(line)
if total == 0 or total % 5 > 0:
	print(-1)
else:
	print(int(total / 5))


s = sum(map(int, input().split()))
print([s // 5, -1][bool(s % 5) or s == 0])


import sys
f = sys.stdin
s = 0
a = [int(u) for u in f.readline().strip().split()]
s = sum(a)
if s % 5 == 0 and s > 0:
	print(s // 5)
else:
	print(-1)


import math
a = list(map(int, input().split()))
n = sum(a)
if n > 0 and n % 5 == 0:
	print(int(n / 5))
else:
	print('-1')


ll = list(map(int, input().split()))
summ = sum(ll)
if summ % 5 == 0 and summ != 0:
	print(summ // 5)
else:
	print(-1)


for _ in range(1):
	a = list(map(int, input().split()))
	s = sum(a)
	if s == 0:
		print(-1)
	elif s % 5 == 0:
		print(s // 5)
	else:
		print(-1)


a = [int(k) for k in input().split(' ')]
if sum(a) == 0:
	print('-1')
elif sum(a) % len(a) == 0:
	print(sum(a) // len(a))
else:
	print('-1')


ms = list(map(int, input().split()))
if sum(ms) % len(ms) != 0 or sum(ms) // len(ms) == 0:
	print(-1)
else:
	print(sum(ms) // len(ms))


a = sum(map(int, input().split()))
print(-1 if not a or a % 5 else a // 5)


import math

def main():
	s = sum(list(map(int, input().split())))
	print(int(s / 5) if s % 5 == 0 and s > 0 else '-1')
main()


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
bets = read_ints()
(each, res) = divmod(sum(bets), len(bets))
if res == 0 and each != 0:
	print(each)
else:
	print(-1)


l = list(map(int, input().split()))
(x, y) = (sum(l), len(l))
if x == 0:
	print('-1')
	exit()
print([x // y, -1][x % y >= 1])


import sys
a = [int(x) for x in input().split()]
s = sum(a) % len(a)
if s or a.count(0) == len(a):
	print(-1)
	sys.exit()
else:
	for i in a:
		if i < 0:
			print(-1)
			sys.exit()
	print(sum(a) // len(a))


import sys
import math
import bisect

def main():
	A = list(map(int, input().split()))
	n = len(A)
	if sum(A) != 0 and sum(A) % n == 0:
		print(sum(A) // n)
	else:
		print(-1)
main()


coins_Sum = 0
for x in input().split():
	coins_Sum += int(x)
if coins_Sum % 5 == 0 and coins_Sum != 0:
	print(coins_Sum // 5)
else:
	print(-1)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
a = read_int_array()
n = sum(a)
print(n // 5 if n != 0 and n % 5 == 0 else -1)


a = input()
b = a.split()
sum = 0
for i in b:
	sum += int(i)
if sum % 5 != 0 or sum == 0:
	print(-1)
else:
	print(sum // 5)


c = [int(x) for x in input().split()]
Sum = sum(c)
if Sum == 0:
	print(-1)
elif Sum % 5 == 0:
	print(Sum // 5)
else:
	print(-1)


c = list(map(int, input().split()))
v = sum(c) // 5
if v != sum(c) / 5 or v == 0:
	print(-1)
else:
	given = 0
	received = 0
	for elem in c:
		if elem > v:
			given += elem - v
		elif elem < v:
			received += v - elem
	if given == received:
		print(v)
	else:
		print(-1)


lst = [i for i in map(int, input().split())]
if sum(lst) % 5 or sum(lst) == 0:
	print(-1)
else:
	print(sum(lst) // 5)


from sys import stdin

def main():
	x = [int(x) for x in stdin.readline().strip().split()]
	d = 0
	for i in range(len(x)):
		d += x[i]
	if d != 0 and d % 5 == 0:
		print(d // 5)
	else:
		print(-1)
main()


x = 0
for i in input().split():
	x = x + int(i)
if not x == 0 and x % 5 == 0:
	print(int(x / 5))
else:
	print(-1)


num = sum((int(i) for i in input().split()))
print([-1, num // 5][num and num % 5 == 0])


c = input().split()
x = 0
while x < len(c):
	c[x] = int(c[x])
	x = x + 1
x = 0
y = c[0] + c[1] + c[2] + c[3] + c[4]
if y % 5 == 0 and y != 0:
	b = int(y / 5)
	print(b)
else:
	print('-1')


a = list(map(int, input().split()))
l = 0
for i in range(min(a), max(a) + 1):
	b = [i - j for j in a if j < i]
	c = [j - i for j in a if j > i]
	if sum(b) == sum(c) and i != 0:
		print(i)
		l = l + 1
		break
if l == 0:
	print('-1')


import operator as op
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import reduce
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

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

def instr():
	s = input()
	return list(s[:len(s)])

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

def def_value():
	return 0
a = inlist()
tot = sum(a)
n = len(a)
if tot % n == 0 and tot > 0:
	print(tot // n)
else:
	print(-1)


numbers = map(int, input().split())
add = sum(numbers)
if add % 5 == 0 and add / 5 != 0:
	print(int(add / 5))
else:
	print('-1')


n = list(map(int, input().split()))
la = list(range(min(n), max(n) + 1))
hh = 0
for item in la:
	b = 0
	j = 0
	for x in n:
		if item - x > 0:
			b += item - x
		else:
			j += x - item
	if b == j and item > 0:
		print(item)
		hh = 1
		break
if hh == 0:
	print(-1)


n = input().split(' ')
for i in range(5):
	n[i] = int(n[i])
if sum(n) % 5 == 0:
	if sum(n) > 0:
		print(sum(n) // 5)
	else:
		print(-1)
else:
	print(-1)


s = sum(map(int, input().split())) / 5
print([int(s), -1][int(s) != s or s < 1])


def initial_bet(n, b):
	d = sum([int(i) for i in b])
	if d % n == 0 and d != 0:
		return d // n
	else:
		return -1
c = list(map(int, input().split()))
print(initial_bet(len(c), c))


s = sum(tuple(map(int, input().split())))
if s % 5 == 0 and s != 0:
	print(int(s / 5))
else:
	print('-1')


arr = list(map(int, input().split()))
sum = 0
for i in arr:
	sum += i
if sum == 0:
	print(-1)
elif sum % 5 == 0:
	print(int(sum / 5))
else:
	print(-1)


a = list(map(int, input().split()))
n = len(a)
asum = sum(a)
if asum % n == 0 and asum > 0:
	print(asum // n)
else:
	print(-1)


sum = 0
data = input()
tmp = list(data.split(' '))
for i in range(0, 5):
	sum += int(tmp[i])
if sum % 5:
	res = -1
else:
	res = sum / 5
if res == 0:
	res = -1
print(int(res))


a = [int(i) for i in input().split(' ')]
s = 0
for i in range(len(a)):
	s = s + a[i]
if s % len(a) == 0 and s != 0:
	print(s // len(a))
else:
	print(-1)


A = input().split()
x = 5
s = 0
for i in range(5):
	s += int(A[i])
if s % x == 0 and s != 0:
	print(str(s // x))
else:
	print('-1')


hodnoty = map(int, input().split())
sucet = sum(hodnoty)
if sucet % 5 or sucet == 0:
	print('-1')
else:
	print(sucet // 5)


is_debug = False
c = [int(x) for x in input().split()]
t = sum(c, 0)
v = int(t / 5)
print(f't={t}, v={v}') if is_debug else ''
print(f'{(v if v != 0 and v * 5 == t else -1)}')


l = [int(i) for i in input().split()]
if sum(l) % len(l):
	print(-1)
else:
	print(sum(l) // len(l) if sum(l) // len(l) else -1)


import sys
fin = sys.stdin
fout = sys.stdout
s = sum(map(int, fin.readline().strip().split()))
print('-1' if s == 0 or s % 5 != 0 else str(s // 5), file=fout)


coins = list(map(int, input().split(' ')))
res = sum(coins) // len(coins)
check = sum(coins) % len(coins) == 0
if check and sum(coins) != 0:
	print(res)
else:
	print(-1)


(x1, x2, x3, x4, x5) = map(int, input().split())
if (x1 + x2 + x3 + x4 + x5) % 5 == 0 and x1 + x2 + x3 + x4 + x5 != 0:
	print((x1 + x2 + x3 + x4 + x5) // 5)
else:
	print(-1)


li = [int(x) for x in input().split()]
total = sum(li)
if total % 5 == 0 and total != 0:
	print(total // 5)
else:
	print(-1)


(q, w, e, r, t) = map(int, input().split())
if (q + w + e + r + t) % 5 == 0 and q + w + e + r + t != 0:
	print((q + w + e + r + t) // 5)
else:
	print(-1)


l = sum(map(int, input().split()))
print([l // 5, -1][l % 5 != 0 or l == 0])


d = input()
summ = 0
for i in d.split():
	summ += int(i)
if summ % 5 == 0 and summ != 0:
	summ //= 5
else:
	summ = -1
print(summ)


(a1, a2, a3, a4, a5) = map(int, input().split())
if (a1 + a2 + a3 + a4 + a5) % 5 != 0 or a1 + a2 + a3 + a4 + a5 == 0:
	print(-1)
else:
	print((a1 + a2 + a3 + a4 + a5) // 5)


def main():
	numbers = input().split(' ')
	Sum = 0
	for i in range(0, len(numbers)):
		numbers[i] = int(numbers[i])
		Sum += numbers[i]
	if Sum == 0:
		print('-1')
	elif Sum % 5 == 0:
		print(Sum // 5)
	else:
		print('-1')
main()


(c1, c2, c3, c4, c5) = map(int, input().split())
summ = c1 + c2 + c3 + c4 + c5
if summ == 0:
	print('-1')
elif summ % 5 == 0:
	print(summ // 5)
else:
	print('-1')


line = [int(x) for x in input().split()]
n = sum(line)
if n % 5 == 0 and n > 0:
	print(int(n / 5))
else:
	print(-1)


n_str = input().split()
res = -1
sum = 0
for i in range(0, 5):
	sum += int(n_str[i])
if sum % 5 == 0 and sum > 0:
	print(int(sum / 5))
else:
	print(-1)


numbers = list(map(int, input().split()))
r = sum(numbers)
if r == 0 or r % 5 != 0:
	print(-1)
else:
	print(r // 5)


(bet, mod) = divmod(sum(map(int, input().split())), 5)
print(-1 if mod or not bet else bet)


data = [int(x) for x in input().split()]
sum_ = sum(data)
if sum_ >= 5 and sum_ % 5 == 0:
	print(sum_ // 5)
else:
	print(-1)


Datos = input()
Datos = Datos.split()
Suma = 0
for K in range(len(Datos)):
	Suma = Suma + int(Datos[K])
if Suma > 0:
	if Suma % 5 == 0:
		print(Suma // 5)
	else:
		print('-1')
else:
	print('-1')


c = [int(c) for c in input().split()]
total = sum(c)
(div, mod) = divmod(total, 5)
print(div if mod == 0 and div > 0 else -1)


l = list(map(int, input().split()))
total = 0
for i in range(len(l)):
	total += l[i]
if total < 5:
	print(-1)
elif total % 5 == 0:
	print(total // 5)
else:
	print(-1)


n = list(map(int, input().split()))
b = sum(n)
if b == 0 or not b % 5 == 0:
	print(-1)
elif b % 5 == 0:
	print(int(b / 5))


lst = [int(i) for i in input().split()]
if sum(lst) == 0:
	print('-1')
elif sum(lst) % 5 == 0:
	print(sum(lst) // 5)
else:
	print('-1')


(a, b, c, d, e) = map(int, input().split())
a = a + b + c + d + e
if not a or a % 5:
	print(-1)
else:
	print(a // 5)


print((lambda x: -1 if x % 5 or not x else x // 5)(sum(map(int, input().split()))))


def initial_bet():
	s = sum(map(int, input().split()))
	if s % 5 == 0 and s != 0:
		print(int(s / 5))
	else:
		print(-1)
initial_bet()


l = input().split()
s = 0
a = int(l[0])
b = int(l[1])
c = int(l[2])
d = int(l[3])
e = int(l[4])
s = a + b + c + d + e
if s == 0:
	print(-1)
elif s % 5 == 0:
	print(s // 5)
else:
	print(-1)


(c1, c2, c3, c4, c5) = input().split()
c1 = int(c1)
c2 = int(c2)
c3 = int(c3)
c4 = int(c4)
c5 = int(c5)
if c1 >= 0 and c1 <= 100 and (c2 >= 0) and (c2 <= 100) and (c3 >= 0) and (c3 <= 100) and (c4 >= 0) and (c4 <= 100) and (c5 >= 0) and (c5 <= 100):
	total = c1 + c2 + c3 + c4 + c5
	if total % 5 == 0 and (not total == 0):
		initial = total / 5
		initial = int(initial)
		if initial != 0:
			print(initial)
		else:
			print('-1')
	else:
		print('-1')


import functools
n = [int(x) for x in input().split()]
result = -1
summ = functools.reduce(lambda x, y: x + y, n, 0)
if summ >= 5 and summ % 5 == 0:
	result = summ / 5
print('%d' % result)


s = input()
a = [int(i) for i in s.split()]
sum1 = a[0] + a[1] + a[2] + a[3] + a[4]
if sum1 % 5 == 0 and sum1 > 0:
	print(int(sum1 / 5))
else:
	print(-1)


inp = input()
nums = [int(i) for i in inp.split()]
temp = sum(nums)
if temp == 0:
	print('-1')
elif temp % len(nums) == 0:
	print(int(temp / len(nums)))
else:
	print('-1')


d = [int(_) for _ in input().split()]
if sum(d) % len(d) == 0 and sum(d) != 0:
	print(sum(d) // len(d))
else:
	print('-1')


arr = list(map(int, input().split()))
(q, r) = divmod(sum(arr), len(arr))
if q > 0 and r == 0:
	print(q)
else:
	print(-1)


a = list(map(int, input().strip().split(' ')))
c = sum(a)
if c == 0:
	print('-1')
else:
	print(c // len(a) if c % len(a) == 0 else '-1')


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest

def binNumber(n, size):
	return bin(n)[2:].zfill(size)

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
a = list(map(int, input().split()))
if sum(a) % len(a) == 0 and a != [0] * len(a):
	print(sum(a) // len(a))
else:
	print(-1)


from sys import stdin
x = sum(map(int, stdin.readline().split()))
print(-1 if x % 5 or x <= 0 else x // 5)


vals = [int(x) for x in input().split()]
s = 0
for v in vals:
	s += v
if not s or s % 5:
	print(-1)
else:
	print(int(s / 5))


(c1, c2, c3, c4, c5) = list(map(int, input().split()))
x = c1 + c2 + c3 + c4 + c5
if x == 0:
	print(-1)
elif x % 5 == 0:
	print(x // 5)
else:
	print(-1)


try:
	s = sum([int(i) for i in input().split()])
	if s == 0:
		print(-1)
	elif s % 5 == 0:
		print(s // 5)
	else:
		print(-1)
except Exception as excp:
	exit


myList = input().split()
total = sum(map(int, myList))
if total != 0 and total % 5 == 0:
	print(int(total / 5))
else:
	print('-1')


nums = [int(x) for x in input().split()]
medium = sum(nums) / len(nums)
if not medium.is_integer() or medium < 1:
	medium = -1
print(int(medium))


t = input()
l = list(map(int, t.split(' ')))
n = sum(l)
if n % 5 == 0:
	p = int(n / 5)
	if p == 0:
		print(-1)
	else:
		print(p)
else:
	print(-1)


(c1, c2, c3, c4, c5) = input().split()
(c1, c2, c3, c4, c5) = (int(c1), int(c2), int(c3), int(c4), int(c5))
s = c1 + c2 + c3 + c4 + c5
if s == 0:
	ans = -1
elif s % 5 == 0:
	ans = s // 5
else:
	ans = -1
print(ans)


try:
	l = list(map(int, input().split()))
	a = sum(l)
	if a % 5 == 0 and a != 0:
		print(a // 5)
	else:
		print(-1)
except:
	pass


arr = [int(x) for x in input().strip().split(' ')]
K = sum(arr) / 5
if K == int(K) != 0:
	print(int(K))
else:
	print(-1)


import sys
A = list(map(int, sys.stdin.readline().split()))
total = sum(A)
if total == 0:
	print(-1)
else:
	(div, mod) = divmod(total, 5)
	if mod == 0:
		print(div)
	else:
		print(-1)


import sys

def solve(xs):
	total = sum(xs)
	if total % 5 > 0 or total == 0:
		return -1
	else:
		return total // 5

def print_stderr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def main():
	cs = [int(i) for i in input().strip().split()]
	assert len(cs) == 5
	result = solve(cs)
	print(result)
main()


value = sum(map(int, input().split())) / 5
if value.is_integer() and value != 0:
	print(int(value))
else:
	print('-1')


L = input('').split()
l = []
for i in L:
	l.append(int(i))
if sum(l) % 5 != 0:
	print(-1)
elif sum(l) == 0:
	print(-1)
else:
	a = sum(l) / 5
	print(int(a))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def abs(x):
	return x if x >= 0 else -x

def sumelem(x, start, end):
	sum = 0
	for i in range(start, end + 1):
		sum += x[i]
	return sum
for t in range(1):
	end = list(map(int, input().split()))
	if all((elem == end[0] for elem in end)):
		if end[0] == 0:
			print(-1)
		else:
			print(end[0])
	else:
		sum = 0
		for i in end:
			sum += i
		each = sum // 5
		initial = [each - i for i in end]
		sum = 0
		for i in initial:
			sum += i
		if sum == 0:
			print(each)
		else:
			print(-1)


a = list(map(int, input().split()))
k = 0
for c in a:
	k += c
if k % 5 == 0 and k > 0:
	print(int(k / 5))
else:
	print(-1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
c = list(map(int, input().split()))
if sum(c) % 5 == 0 and sum(c) > 0:
	print(int(sum(c) / 5))
else:
	print(-1)


i_s = sum([int(tmp) for tmp in input().strip('\n\r\t ').split(' ')])
if i_s > 0 and i_s % 5 == 0:
	print(i_s // 5)
else:
	print(-1)


a = list(map(int, input().split()))
if sum(a) % 5 == 0 and sum(a) > 0 and all((i >= 0 for i in a)):
	print(sum(a) // 5)
else:
	print(-1)


import sys
import math
c = [int(x) for x in sys.stdin.readline().split()]
l = len(c)
vsum = sum(c)
if vsum != 0 and vsum % l == 0:
	print(int(vsum / l))
else:
	print(-1)


l = list(map(int, input().split()))
p = sum(l)
n = len(l)
if p % n == 0 and p > 0:
	print(p // n)
else:
	print(-1)


coins = list(map(int, input().split()))
(bet, mod) = divmod(sum(coins), len(coins))
print(-1 if mod or not bet else bet)


a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
if (sum(a) / len(a)).is_integer() and sum(a) != 0:
	print(int(sum(a) / len(a)))
else:
	print(-1)


import math
z = list(map(int, input().split()))
x = math.modf(sum(z) / 5)
print(['-1', '%d' % (sum(z) // 5)][x[0] == 0 and sum(z) != 0])


players = list(map(int, input().split()))
s = sum(players)
l = len(players)
a = s / l
if s == 0:
	print(-1)
elif s % 5 == 0:
	print(int(a))
else:
	print(-1)


a = [int(x) for x in input().split()]
c1 = a[0] + a[1] + a[2] + a[3] + a[4]
if c1 % 5 == 0:
	c1 = int(c1 / 5)
	if c1 == 0:
		c1 = -1
	print(c1)
else:
	print(-1)


ls = [int(i) for i in input().split()]
val = sum(ls)
initial = val // len(ls)
if val == 0:
	print('-1')
elif initial * len(ls) == val:
	print(initial)
else:
	print('-1')


nums = [int(x) for x in input().split()]
nums_sum = sum(nums)
if nums_sum % len(nums) != 0 or nums_sum == 0:
	print(-1)
else:
	print(nums_sum // len(nums))


import sys

def main():
	fin = sys.stdin
	fout = sys.stdout
	s = sum(list(map(int, fin.readline().split())))
	if s == 0 or s % 5 != 0:
		print(-1)
	else:
		print(s // 5)
	fin.close()
	fout.close()
main()


arr = [int(__) for __ in input().strip().split()]
x = sum(arr) / 5
if int(x) != x or x == 0:
	print(-1)
else:
	print(int(x))


sum_in = sum(map(int, input().strip().split(' ')))
print(int(sum_in / 5) if sum_in % 5 == 0 and sum_in > 0 else -1)


s = sum(list((int(a) for a in input().split())))
if s % 5 or s == 0:
	print(-1)
else:
	print(s // 5)


n = list(map(int, input().split()))
sum1 = sum(n)
if sum1 % 5 == 0 and sum1 != 0:
	print(sum1 // 5)
else:
	print(-1)


import functools
import operator
(x, y) = divmod(functools.reduce(operator.add, list(map(int, input().split()))), 5)
print('-1' if y or x == 0 else x)


arrayOfPoints = input().split()
sum = 0
for i in range(5):
	sum += int(arrayOfPoints[i])
if sum == 0 or sum % 5 != 0:
	print(-1)
else:
	print(sum // 5)


ip = map(int, input().split())
count = 0
for j in ip:
	count += j
if count % 5 == 0 and count != 0:
	print(int(count / 5))
else:
	print(-1)


def function1(n):
	n = sum(n)
	if n % 5 != 0 or n == 0:
		return -1
	else:
		return n // 5
	return sum(n) // 5

def main():
	n = list(map(int, input().split()))
	print(function1(n))
main()


sum_ai = 0
count_i = 0
for i in input().split(' '):
	sum_ai += int(i)
	count_i += 1
if sum_ai % count_i == 0 and sum_ai != 0:
	print(sum_ai // count_i)
else:
	print(-1)


d = list(map(int, input().split()))
sum = 0
for i in d:
	sum += i
if sum % len(d) == 0 and sum != 0:
	print(sum // len(d))
else:
	print(-1)


L = list(map(int, input().split()))
s = sum(L)
n = len(L)
if s % n == 0 and s != 0:
	print(s // n)
else:
	print(-1)


l = input().split()
i = int(l[0]) + int(l[1]) + int(l[2]) + int(l[3]) + int(l[4])
if i % 5 == 0 and l != ['0', '0', '0', '0', '0']:
	print(i // 5)
else:
	print(-1)


a = list(map(int, input().strip().split()))
s = sum(a)
k = len(a)
if len(set(a)) == 1:
	if a[0] == 0:
		print(-1)
	if a[0] > 0:
		print(*set(a))
if len(set(a)) > 1:
	if s % k == 0:
		print(s // k)
	if s % k != 0:
		print(-1)


s = [int(numb) for numb in input().split()]
total = 0
for digit in s:
	total += digit
if total % 5 > 0 or total == 0:
	print(-1)
else:
	print(total // 5)


from sys import stdin
(x1, x2, x3, x4, x5) = map(int, stdin.readline().rstrip().split(' '))
s = sum([x1, x2, x3, x4, x5])
if s % 5 != 0:
	print(-1)
elif s == 0:
	print(-1)
else:
	print(s // 5)


import sys
(c1, c2, c3, c4, c5) = map(int, input().split())
ans = -1
s = c1 + c2 + c3 + c4 + c5
if s % 5 == 0:
	ans = s // 5
	if s == 0:
		ans = -1
print(ans)


n = map(int, input().split())
s = sum(n)
if s == 0 or not s % 5 == 0:
	print('-1')
elif s % 5 == 0:
	print(int(s / 5))


c = sum(map(int, input().split()))
print(int([c / 5, -1][c % 5 > 0 or c == 0]))


from math import *
from collections import *
a = list(map(int, input().split()))
if sum(a) % 5 == 0 and sum(a) > 0:
	print(sum(a) // 5)
else:
	print(-1)


ans = sum(list(map(int, input().split())))
print([-1, ans // 5][not ans % 5 and ans > 0])


def main():
	s = sum(list(map(int, input().split(' '))))
	ss = s // 5
	if ss == 0:
		return -1
	return ss if ss * 5 == s else -1
print(main())


from sys import stdin

def main():
	inp = stdin
	nums = sum(list(map(int, inp.readline().split())))
	if nums % 5 == 0 and nums != 0:
		print(nums // 5)
	else:
		print(-1)
main()


a = input().split(' ')
for i in range(len(a)):
	a[i] = int(a[i])
sums = int(a[0] + a[1] + a[2] + a[3] + a[4])
if sums < 5:
	print('-1')
elif sums % 5 == 0:
	print(int(sums // 5))
else:
	print('-1')


import math
a = list(map(int, input().split()))
s = int(0)
for i in range(5):
	s += a[i]
if s == 0:
	print(-1)
elif math.ceil(s / 5) == s / 5:
	print(int(s / 5))
else:
	print(-1)


e = [int(string) for string in input().split()]
s = sum(e)
c = len(e)
if s == 0:
	print(-1)
else:
	print(s // c if s % c == 0 else -1)


s = [int(x) for x in input().split()]
l = sum(s)
if l % 5 or l == 0:
	print(-1)
else:
	print(l // 5)


x = sum([int(i) for i in list(input().split())])
print(x // 5 if x % 5 == 0 and x != 0 else -1)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
A = [int(x) for x in input().split()]
N = len(A)
s = sum(A)
if s > 0 and s % N == 0:
	print(s // N)
else:
	print(-1)


given = (int(x) for x in input().split(' '))

def main():
	s = sum(given)
	if s < 5:
		print(-1)
		return
	if s % 5 == 0:
		print(s // 5)
	else:
		print(-1)
main()


final_bet = [int(i) for i in input().split()]
sum = 0
for i in range(0, 5, 1):
	sum += final_bet[i]
if sum > 0 and sum % 5 == 0:
	print(int(sum / 5))
else:
	print('-1')


import sys
cn = list(map(int, sys.stdin.readline().split()))
total = sum(cn)
if total >= 5 and total % 5 == 0:
	print(int(total / 5))
else:
	print('-1')


mySum = 0
for num in [int(x) for x in input().split()]:
	mySum += num
if mySum % 5 == 0 and mySum != 0:
	print(mySum // 5)
else:
	print('-1')


x = [int(x) for x in input().split()]
a = 0
for i in range(len(x)):
	a += x[i]
if a == 0:
	print(-1)
elif a % 5 == 0:
	print(a // 5)
else:
	print(-1)


line = [int(i) for i in input().split()]
s = sum(line)
if s == 0:
	print('-1')
else:
	r = s % 5
	if r == 0:
		print(s // 5)
	else:
		print('-1')


from sys import stdin
lista = [int(x) for x in stdin.readline().strip().split()]
z = 0
for i in range(len(lista)):
	z += lista[i]
if z == 0:
	print(-1)
elif z % len(lista) == 0:
	print(z // len(lista))
else:
	print(-1)


(a, b, c, d, e) = [int(t) for t in input().split()]
v = int((a + b + c + d + e) / 5)
t = (a + b + c + d + e) % 5
if t == 0 and v != 0:
	print(v)
elif v == 0:
	print(-1)
else:
	print(-1)


list1 = list(map(int, input().strip().split(' ')))
s = sum(list1)
if s % 5 == 0 and s // 5 > 0:
	print(s // 5)
else:
	print(-1)


end = input().split()
SUM = 0
for i in end:
	SUM = SUM + int(i)
if SUM == 0:
	print(-1)
elif SUM % 5 == 0:
	print(int(SUM / 5))
else:
	print(-1)


def arr_inp():
	return [int(x) for x in input().split()]
c = arr_inp()
while True:
	(ma, mi) = (max(c), min(c))
	(ix_ma, ix_mi) = (c.index(ma), c.index(mi))
	if ma - mi == 1 or ma == mi == 0:
		exit(print(-1))
	if ma - mi == 0:
		exit(print(c[0]))
	c[ix_ma] -= 1
	c[ix_mi] += 1


a = [int(x) for x in input().split()]
s = 0
for i in a:
	s += i
if s % 5 == 0 and s:
	print(int(s / 5))
else:
	print(-1)


ipt = [int(x) for x in input().split()]
middle = sum(ipt) / 5
if middle.is_integer() and middle != 0:
	print(int(middle))
else:
	print(-1)


temp_list = str(input()).split()
temp_list = [int(it) for it in temp_list]
temp_sum = sum(temp_list)
if temp_sum > 0 and temp_sum % 5 == 0:
	print(int(temp_sum / 5))
else:
	print(-1)


n = list(map(int, input().split()))
w = sum(n) / 5
qu = int(w)
if qu == w and qu != 0:
	print(qu)
if qu != w or qu == 0:
	print(-1)


from sys import stdin, stdout, stderr, setrecursionlimit
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	import inspect, re
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readintarr(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writearr(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
import statistics
cs = readintarr()
m = statistics.mean(cs)
if int(m) == m and m != 0:
	write(int(m))
else:
	write(-1)


import sys
s = sum(map(int, input().split()))
if s % 5 == 0 and s > 0:
	print(s // 5)
else:
	print(-1)


res = 0
mylist = list(map(int, input().split()))
for i in range(5):
	res = res + mylist[i]
if res == 0:
	print('-1')
elif res % 5 == 0:
	print(int(res / 5))
else:
	print('-1')


from sys import stdin

def anfel():
	a = stdin.readline().split()
	for i in range(len(a)):
		a[i] = int(a[i])
	b = len(a)
	c = 0
	for i in range(len(a)):
		c += a[i]
	if c % b == 0 and c != 0:
		print(c // b)
	else:
		print(-1)
anfel()


n = [int(i) for i in input().split()]
s = sum(n)
m = len(n)
if n.count(0) == len(n):
	print('-1')
elif s % m == 0:
	print(s // m)
else:
	print('-1')


s = [int(x) for x in input().split()]
n = len(s)
w = sum(s)
if w == 0:
	print(-1)
elif w % n == 0:
	print(int(w / n))
else:
	print(-1)


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def solve():
	(a, b, c, d, e) = map(int, input().split())
	sum = a + b + c + d + e
	if sum == 0:
		print(-1)
		return
	if sum % 5 == 0:
		print(int(sum / 5))
	else:
		print(-1)
solve()


a = [int(i) for i in input().split()]
i = 0
h = 0
while i < len(a):
	h = h + a[i]
	i += 1
if h % len(a) == 0 and h > 0:
	print(h // len(a))
else:
	print(-1)


i = input()
li = list(i.split(' '))
li = [int(x) for x in li]
a = li[0]
b = li[1]
c = li[2]
d = li[3]
e = li[4]
f = int(0)
if (a + b + c + d + e) % 5 == 0 and a + b + c + d + e > 0:
	f = int((a + b + c + d + e) / 5)
	print(f)
else:
	print('-1')


import math
sumc = sum((int(x) for x in input().split()))
print(sumc // 5 if sumc > 0 and sumc % 5 == 0 else -1)


c = list(map(int, input().split()))
s = sum(c)
(m, n) = divmod(s, 5)
if n == 0 and m != 0:
	print(m)
else:
	print(-1)


p = input()
p = p.split()
c = 0
for i in range(5):
	c += int(p[i])
if c % 5 == 0 and c != 0:
	print(c // 5)
else:
	print(-1)


coins = list(map(int, input().split()))
sum = 0
for coin in coins:
	sum += coin
if sum % 5 == 0 and sum != 0:
	print(sum // 5)
else:
	print(-1)


li = list(map(int, input().split()))
sum_li = sum(li)
if sum_li % 5 == 0 and sum_li:
	print(sum_li // 5)
else:
	print('-1')


ar = [int(i) for i in input().split()]
res = 0
for i in ar:
	res += i
res /= 5
if str(res)[-1] == '0' and res != 0:
	print(int(res))
else:
	print(-1)


def main(arr):
	sum = 0
	for i in range(len(arr)):
		sum += int(arr[i])
	if sum % 5 == 0 and sum != 0:
		return sum // 5
	else:
		return -1
arr = input().split()
print(main(arr))


def main():
	bets = list(map(int, input().split()))
	if sum(bets) % 5 == 0:
		if sum(bets) == 0:
			print(-1)
		else:
			print(int(sum(bets) / 5))
	else:
		print(-1)
main()


pool = sum([int(c) for c in input().split()])
if pool != 0 and pool % 5 == 0:
	print(pool // 5)
else:
	print(-1)


def players(s):
	a = 0
	for i in s:
		a = a + i
	if a % 5 == 0 and a != 0:
		return a // 5
	else:
		return -1
l = list(map(int, input().split()))
print(players(l))


num = [int(x) for x in input().split()]
import sys
if sum(num) % 5 != 0 or sum(num) == 0:
	print(-1)
	sys.exit()
aver = sum(num) // 5
delta = [x - aver for x in num]
print(aver)


c = list(map(int, input().split()))
sum = 0
for i in range(len(c)):
	sum += c[i]
if sum % 5 != 0 or sum == 0:
	print(-1)
else:
	print(sum // 5)


a = list(map(int, input().split()))
x = max(a)
y = min(a)
if max(a) == 0:
	print('-1')
else:
	for i in range(y, x + 1):
		t = [j - i for j in a]
		if sum(t) == 0:
			print(i)
			break
	else:
		print('-1')


def solution(a, b, c, d, e):
	res = a + b + c + d + e
	if res < 5 or res % 5 != 0:
		return -1
	return res // 5
f = lambda : map(int, input().split())
(a, b, c, d, e) = f()
print(solution(a, b, c, d, e))


s = 0
a = input().split()
for x in a:
	s += int(x)
if s % 5 or not s:
	print('-1')
else:
	print(s // 5)


from sys import stdin, stdout
arr = list(map(int, stdin.readline().split()))
s = sum(arr)
l = len(arr)
if s == 0 and l > 0:
	stdout.write('-1\n')
else:
	a = s / l
	if a.is_integer():
		stdout.write(str(int(a)) + '\n')
	else:
		stdout.write('-1\n')


a = [int(i) for i in input().split()]
b = a[0] + a[1] + a[2] + a[3] + a[4]
if b % 5 == 0:
	if b / 5 != 0:
		print(int(b / 5))
	else:
		print(-1)
else:
	print(-1)


a = [int(x) for x in input().split()]
b = sum(a)
if b % 5 == 0 and b > 0:
	print(b // 5)
else:
	print(-1)


(c1, c2, c3, c4, c5) = [int(x) for x in input().split()]
b = sum([c1, c2, c3, c4, c5]) / 5
if b != int(b) or b == 0:
	print(-1)
	exit()
(ic1, ic2, ic3, ic4, ic5) = [int(b)] * 5
while ic1 != c1:
	if ic1 > c1:
		ic1 -= 1
		ic2 += 1
	else:
		ic1 += 1
		ic2 -= 1
while ic2 != c2:
	if ic2 > c2:
		ic2 -= 1
		ic3 += 1
	else:
		ic2 += 1
		ic3 -= 1
while ic3 != c3:
	if ic3 > c3:
		ic3 -= 1
		ic4 += 1
	else:
		ic3 += 1
		ic4 -= 1
while ic4 != c4:
	if ic4 > c4:
		ic4 -= 1
		ic5 += 1
	else:
		ic4 += 1
		ic5 -= 1
if ic5 == c5:
	print(int(b))
else:
	print(-1)