Problem: Kilani and Abd are neighbors for 3000 years, but then the day came and Kilani decided to move to another house. As a farewell gift, Kilani is going to challenge Abd with a problem written by their other neighbor with the same name Abd.

<image>

The problem is:

You are given a connected tree rooted at node 1.

You should assign a character a or b to every node in the tree so that the total number of a's is equal to x and the total number of b's is equal to n - x.

Let's define a string for each node v of the tree as follows: 

  * if v is root then the string is just one character assigned to v: 
  * otherwise, let's take a string defined for the v's parent p_v and add to the end of it a character assigned to v. 



You should assign every node a character in a way that minimizes the number of distinct strings among the strings of all nodes.

Input

The first line contains two integers n and x (1 ≤ n ≤ 10^5; 0 ≤ x ≤ n) — the number of vertices in the tree the number of a's.

The second line contains n - 1 integers p_2, p_3, ..., p_{n} (1 ≤ p_i ≤ n; p_i ≠ i), where p_i is the parent of node i.

It is guaranteed that the input describes a connected tree.

Output

In the first line, print the minimum possible total number of distinct strings.

In the second line, print n characters, where all characters are either a or b and the i-th character is the character assigned to the i-th node.

Make sure that the total number of a's is equal to x and the total number of b's is equal to n - x.

If there is more than one answer you can print any of them.

Example

Input


9 3
1 2 2 4 4 4 3 1


Output


4
aabbbbbba

Note

The tree from the sample is shown below:

<image>

The tree after assigning characters to every node (according to the output) is the following:

<image>

Strings for all nodes are the following: 

  * string of node 1 is: a
  * string of node 2 is: aa
  * string of node 3 is: aab
  * string of node 4 is: aab
  * string of node 5 is: aabb
  * string of node 6 is: aabb
  * string of node 7 is: aabb
  * string of node 8 is: aabb
  * string of node 9 is: aa



The set of unique strings is \{a, aa, aab, aabb\}, so the number of distinct strings is 4.

Solution (in CPP):

Solution:
#include<bits/stdc++.h>

using namespace std;

#define FOR(i, j, k) for(int i = j; i <= k; i++)
#define ROF(i, j, k) for(int i = j; i >= k; i--)
#define PB push_back
#define MEM(n, val) memset((n), val, sizeof(n))
#define FastIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define F first
#define S second
#define MP make_pair
#define LL long long
#define MOD 1000000007
#define MX 200010
#define INFL 1000000000000000000LL
#define INF 1000000000

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

int fx[] = {0, 0, 1, -1};
int fy[] = {1, -1, 0, 0};

int n, x;
vector<int> adjl[100010];
int mxlev;
int mxfreq;
int lev_freq[100010];
int freq[100010];
vector<PII> frv;
bool is_lev_a[100010];
int lev[100010];
vector<int> ultalv[100010];


void func(int u, int lv) {
    mxlev = max(lv, mxlev);
    lev_freq[lv]++;
    lev[u] = lv;
    ultalv[ lv ].PB(u);
    for(int v: adjl[u]) {
        func(v, lv + 1);
    }
}

int dp[450][100001];
//PII bt[320][100001];

map<int, int> mp_cnt;

int main() {
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
    FastIO;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

    cin >> n >> x;
    FOR(v, 2, n) {
        int u;
        cin >> u;
        adjl[u].PB(v);
//        cout << u << " : " << v << "\n";
    }

    func(1, 1);


    FOR(i, 1, mxlev) {
        freq[ lev_freq[i] ]++;
        mxfreq = max(mxfreq, lev_freq[i]);
    }
    FOR(i, 1, mxfreq) {
        if(freq[i]) {
            frv.PB({i, freq[i]});
        }
    }

//    FOR(i, 1, mxlev) {
//        cout << i << " : " << lev_freq[i] << "\n";
//    }
//    cout << "\n";
//    FOR(i, 1, mxfreq) {
//        cout << i << " : " << freq[i] << "\n";
//    }
//    cout << "\n";
//    for(PII val: frv) {
//        cout << val.F << " : " << val.S << "\n";
//    }
//    if(x == 237) {
//        cout << "sz : " << frv.size() << endl;
//    }
    MEM(dp, -1);
//    MEM(bt, -1);
    int turn = 0;
    for(int i = 0; i < frv.size(); i++) {
        int val = frv[i].F;
        int fr = frv[i].S;
        dp[i][0] = 0;
        for(int j = 1; j <= x; j++) {
            if(i != 0 && dp[i - 1][j] >= 0) {
                dp[i][ j ] = 0;
//                bt[i][j] = {i - 1, j};
                continue;
            }
            if((j - val >= 0) && (dp[i][j - val] >= 0) && (dp[i][j - val] < fr)) {
                dp[i][j] = dp[i][j - val] + 1;
//                bt[i][j] = {i, j - val};
            }
        }
    }

//    cout << "dp : \n";
//    for(int i = 0; i < frv.size(); i++) {
//        for(int j = 0; j <= x; j++) {
//            cout << dp[i][j] << " ";
//        }
//        cout << "\n";
//    }
//    cout << "\n";
//
//    cout << dp[ (int)frv.size() - 1 ][x] << "\n\n";

    if(dp[ (int)frv.size() - 1 ][x] >= 0) {
        int a = frv.size() - 1, b = x;
        while(a != -1 && b != -1) {
            if(dp[a][b]) {
//                cout << frv[a].F << " : " << dp[a][b] << "\n";
                mp_cnt[ frv[a].F ] = max(mp_cnt[ frv[a].F ], dp[a][b]);
            }
    //        cout << a << " " << b << " : " << frv[a].F << " : " << dp[a][b] << "\n";
            PII nn = {-1, -1};
            if(a != 0 && dp[a][b] == 0 && dp[a - 1][b] >= 0) {
                nn = {a - 1, b};
            }
            int val = frv[a].F;
            int fr = frv[a].S;
            if((b - val >= 0) && (dp[a][b - val] >= 0) && (dp[a][b - val] < fr) && (dp[a][b] == dp[a][b - val] + 1)) {
//                dp[i][j] = dp[i][j - val] + 1;
                nn = {a, b - val};
//                bt[i][j] = {i, j - val};
            }

            a = nn.F;
            b = nn.S;
        }

        FOR(i, 1, mxlev) {
            if(mp_cnt[ lev_freq[i] ]) {
                mp_cnt[ lev_freq[i] ]--;
                is_lev_a[i] = 1;
            }
        }

        cout << mxlev << "\n";
        FOR(i, 1, n) {
            if(is_lev_a[ lev[i] ]) {
                cout << 'a';
            }
            else {
                cout << 'b';
            }
        }
        return 0;
    }

    map<int, int> exp;
    int sum = n;
    FOR(i, 1, mxlev) {
        if(lev_freq[i] <= x) {
            is_lev_a[i] = 1;
            x -= lev_freq[i];
            sum -= lev_freq[i];
        }
        else if(lev_freq[i] <= sum - x) {
            sum -= lev_freq[i];
        }
        else {
            vector<int> leaf, nonleaf;
            for(int u: ultalv[i]) {
                if(adjl[u].size() > 0) {
                    nonleaf.PB(u);
                }
                else {
                    leaf.PB(u);
                }
            }
            if(x >= nonleaf.size()) {
                /// use all x
                sum -= x;
                for(int u: nonleaf) {
                    exp[u] = 1;
                }
                x -= nonleaf.size();
                for(int j = 0; j < x; j++) {
                    int u = leaf[j];
                    exp[u] = 1;
                }
                sum -= leaf.size() - x;
                x = 0;
            }
            else {
                /// use all sum - x
//                sum = x;
//                x = lev_freq[i] - (sum - x);
                sum -= nonleaf.size();
                int leafbaki = (int)leaf.size() - (sum - x);

                for(int j = 0; j < leafbaki; j++) {
                    int u = leaf[j];
                    exp[u] = 1;
                }
                x -= leafbaki;
                sum = x;
            }
        }
    }

    cout << mxlev + 1 << "\n";
    FOR(i, 1, n) {
        if(exp[i]) {
            cout << 'a';
            continue;
        }
        if(is_lev_a[ lev[i] ]) {
            cout << 'a';
        }
        else {
            cout << 'b';
        }
    }
    return 0;
}
/**
2000000000000
*/