nums = []
sum_0 = 0
sum_1 = 0
sum_3 = 0
max_4 = 0
i = 1
j = 0
k = 0
m = 0
nums[ : ] = map(int ,input().split())
nums = nums[1 : ]
for num in nums:
    if num % 10 == 0:
        sum_0 = sum_0 + num
    if num % 5 == 1:
        m = 1
        if i % 2 == 1:
            sum_1 = sum_1 + num
        else:
            sum_1 = sum_1 - num
        i = i + 1
    if num % 5 == 2:
        j = j + 1
    if num % 5 == 3:
        k = k + 1
        sum_3 = sum_3 + num
    if num % 5 == 4:
        if num > max_4:
            max_4 = num
if sum_0 == 0:
    print('N', end = ' ')
else:
    print(sum_0, end = ' ')
if m == 0:
    print('N', end = ' ')
else:
    print(sum_1, end = ' ')
if j == 0:
    print('N', end = ' ')
else:
    print(j, end = ' ')
if k == 0:
    print('N', end = ' ')
else:
    print('%.1f' %(sum_3 / k), end = ' ')
if max_4 == 0:
    print('N')
else:
    print(max_4)