#include<cstdio>

using namespace std;
/*
思路:
    1.用两个数组表示输出,ans[]表示结果,count[]用来计数 
    2.注意此网站是多点测试,所以ans[]和count[]的初始化要放在while里面 
*/


int main(){

    int n;

    while(scanf("%d",&n) != EOF){
        int ans[5] = {0},count[5] = {0}; 
        int a;
        for(int i=0;i<n;i++){
            scanf("%d",&a);
            if(a%5 == 0){        //A1类 
                if(a%2 == 0){
                    ans[0] += a;
                    count[0]++;
                }
            }else if(a%5 == 1){            //A2类 
                if(count[1]%2 == 0){
                    ans[1] += a;
                    count[1]++;
                }else{
                    ans[1] -= a;
                    count[1]++;
                }
            }else if(a%5 == 2){        //A3类 
                ans[2]++;
                count[2]++; 
            }else if(a%5 == 3){        //A4类 
                ans[3] +=a;
                count[3]++;
            }else if(a%5 ==4){        //A5类
                if(a>ans[4])    ans[4] = a;
                count[4]++; 
            }
        }



        if(count[0] == 0)    printf("N ");
        else printf("%d ",ans[0]);
        if(count[1] == 0)    printf("N ");
        else printf("%d ",ans[1]);
        if(count[2] == 0)    printf("N ");
        else printf("%d ",ans[2]);
        if(count[3] == 0)    printf("N ");
        else printf("%.1f ",ans[3]*1.0/count[3]);
        if(count[4] == 0)    printf("N ");
        else printf("%d\n",ans[4]);

    }

    return 0;
}