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
#include <iostream>
#include <string>
#include <bitset>
using namespace std;

string table[26][3] = {
        {"a", "1"},
        {"b", "1"},
        {"c", "2"},
        {"d", "1"},
        {"e", "2"},
        {"f", "2"},
        {"g", "3"},
        {"h", "1"},
        {"i", "2"},
        {"j", "2"},
        {"k", "3"},
        {"l", "2"},
        {"m", "3"},
        {"n", "3"},
        {"o", "4"},
        {"p", "1"},
        {"q", "2"},
        {"r", "2"},
        {"s", "3"},
        {"t", "2"},
        {"u", "3"},
        {"v", "3"},
        {"w", "4"},
        {"x", "2"},
        {"y", "3"},
        {"z", "3"}
    };

bool check(int cnt, string word, int len) {
    /*if(len == 0) {
        if(cnt == 0) {
            cout << word << endl;
            return true;
        } else {
            return false;
        }
    } else if(cnt <= 0) return false;
    */
    if(cnt > 1){
        if(cnt % 2 == 0) {
            for(auto i=0; i<cnt/2; ++i){
                word += "c";
            }
            cout << word;
        } else {
            for(auto i=0; i<(cnt-1)/2; ++i){
                word += "c";
            }
            word += "a";
            cout << word;
        }
    }
    else {
        word = "a";
    }
    //cout << cnt << endl;

    /*for (int i = 0; i < 26; i++)
    {
        string app = word + table[i][0];
      if(check(cnt - stoi(table[i][1]), app, len-1)) {
            return true;
        }
    }*/
    return false;
}

int main() {

    int n;

    cin >> n;

    char s[8000000];

    cin >> s;

    int count1 = 0;

    for (size_t i = 0; i < n*8; ++i)
    {
        char l = s[i];
        if(l == '1') ++count1;
    }

    //cout << bits;

    if((count1 - (2*n)) < n) {
        cout << "NIE";
    } else {
        count1 = count1 - (2*n);
        //cout << count1;
        bool ch = check(count1, "", n);
    }
    

    return 0;
}