import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] arr = new int[n];
for(int i = 0; i < n; i++)
arr[i] = in.nextInt();
int countA1 = 0, countA2 = 0, countA3 = 0, countA4 = 0, countA5 = 0;
int sumA1 = 0, sumA2 = 0,max = 0;
double sumA4 = 0;
for(int i =0; i < n; i++) {
int temp = arr[i];
if(temp % 5 == 0){
if(temp % 2 == 0){
sumA1 += temp;
countA1 += 1;
}
}
if(temp % 5 == 1){
if(countA2 % 2 == 0)
sumA2 += temp;
else
sumA2 -= temp;
countA2 += 1;
}
if(temp % 5 == 2){
countA3 += 1;
}
if(temp % 5 == 3){
sumA4 += temp;
countA4 += 1;
}
if(temp % 5 == 4){
if(temp > max)
max = temp;
countA5 += 1;
}
}
if(countA1 == 0)
System.out.print("N");
else
System.out.print(sumA1 );
if(countA2 == 0)
System.out.print(" N");
else
System.out.print(" " + sumA2 );
if(countA3 == 0)
System.out.print(" N");
else
System.out.print(" " + countA3);
if(countA4 == 0)
System.out.print(" N");
else
System.out.printf(" %.1f",sumA4/countA4);
if(countA5 == 0)
System.out.print(" N");
else
System.out.print(" " + max);
}
}