import java.util.Scanner;
/**
* author:djch
* date:2021/5/28
*
* @author djch*/
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[] count = new int[4]; //用来保存A1、A2、A3、A5
Float count_a4 = new Float(0);
int count_mod2 = 0;
int count_mod4 = 0;
int sum_mod4 = 0;
boolean[] bool = {false,false,false,false,false}; //判断是否有数字
for(int i=0; i<n; i++){
int k = scanner.nextInt();
switch (k%5){ //按题意选择种类
case 0:
if(k%2==0){count[0]+=k;bool[0]=true;}
break;
case 1:
if(count_mod2%2==0){count[1]+=k;}
else{count[1]-=k;}
count_mod2++;
bool[1]=true;
break;
case 2:
count[2]++;
bool[2]=true;
break;
case 3:
count_mod4++;
sum_mod4+=k;
count_a4=(float)sum_mod4/(float)count_mod4;
bool[3]= true;
break;
case 4:
if(k>count[3]){count[3]=k;}
bool[4]=true;
break;
default:
}
}
for(int i=0;i<5;i++){ //有数字,按格式输出
if(bool[i]){
if(i<3){
System.out.print(count[i]+" ");
}
else if(i==3){
System.out.printf("%.1f ",count_a4); //保留1位小数
}
else {
System.out.print(count[3]);
}
}
else{ //无数字,按格式输出N
if(i<4){
System.out.print("N ");
}
else {
System.out.print("N");
}
}
}
}
}