1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#include <bits/stdc++.h>

#define  _2137 0

#define ff first
#define ss second

using namespace std;



int main() {

    int n,num=0;
    scanf("%d",&n);

    
    char cha;
    for(int i=0;i<n*8;++i){
        scanf(" %c",&cha);
        if(cha=='1') ++num;
    }
    if(n==1){

       if(num==3) printf("a");
       else if(num==4) printf("q");
       else if(num==5) printf("u");
       else if(num==6) printf("o");
       else printf("NIE");
       return _2137;
    }
    int miN=num,maX=num,check1=miN%6,check2=maX%3;

    if(check1!=0){
        miN+=6-check1;
    }
    miN/=6;
    if(check2!=0){
        maX-=check2;
    }
    maX/=3;
    /*
    if(miN==n){
        for(int i=0;i<num;++i){
            printf("o");
        }
        return _2137;
    }
    if(maX==n){
        for(int i=0;i<num;++i){
            printf("a");
        }
        //printf("\n");
        return _2137;
    }
    */
    //cout<<miN<<" "<<maX<<" "<<num<<endl;

    if(n>=miN && n<=maX) {

        int a=n,q=0,u=0,o=0,diff=(maX-n)*3;

        if(num%3!=0){
            a-=num%3;
            q+=num%3;
        }
        

        //cout<<a<<" "<<q<<" "<<u<<" "<<o<<" "<<diff<<endl;

        
            if(diff>=n){
                diff-=a;
                a=0;
                q=n;
            }
            else{
                a-=diff;
                q+=diff;

                for(int i=0;i<a;++i){
                    printf("a");
                }
                for(int i=0;i<q;++i){
                    printf("q");
                }
                //printf("\n");
                return _2137;
            }
        
        

        //cout<<a<<" "<<q<<" "<<u<<" "<<o<<" "<<diff<<endl;

        if(diff>=n){
            diff-=q;
            q=0;
            u=n;
        }
        else{
            q=n-diff;
            u=diff;

            for(int i=0;i<q;++i){
                printf("q");
            }
            for(int i=0;i<u;++i){
                printf("u");
            }
            //printf("\n");
            return _2137;

        }

        
        
        //cout<<a<<" "<<q<<" "<<u<<" "<<o<<" "<<diff<<endl;

        if(diff>=n){
            diff-=u;
            u=0;
            o=n;
        }
        else{
            u=n-diff;
            o=diff;

            for(int i=0;i<u;++i){
                printf("u");
            }
            for(int i=0;i<o;++i){
                printf("o");
            }
            //printf("\n");
            return _2137;

        }

        for(int i=0;i<o;++i){
                printf("o");
            }
        //printf("\n");
        return _2137;




    }
    else{
        printf("NIE");
    }

	return _2137;
}