alls = []
while True:
x = int(input())
if not x:
break
alls.append(x)
var = 0
colvars = 0
for i in alls:
if not (i % 7) and len(str(i)) == 2 and str(i)[0]:
var += i
colvars += 1
print(var / colvars)
alls = []
while True:
x = int(input())
if not x:
break
alls.append(x)
var = 0
colvars = 0
for i in alls:
if not (i % 7) and len(str(i)) == 2 and str(i)[0]:
var += i
colvars += 1
print(var / colvars)