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;

typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define mp make_pair
#define fr first
#define sc second

int lg(ll n) {
    assert(n > 0);
    int ans = -1;
    while (n) {
        ans++;
        n >>= 1;
    }
    return ans;
}

void solve() {
    int n, x;
    cin >> n >> x;
    pair<int, char> a = mp(x, 'a'), b = mp(n - x, 'b');
    if (a > b) {
        assert(x > n - x);
        swap(a, b);
        x = n - x;
    }
    vector<vector<int>> adj(n);
    for (int i = 1; i < n; i++) {
        int p;
        cin >> p;
        p--;
        adj[p].push_back(i);
    }
    vector<int> dep(n), sz(n);
    dep[0] = 0;
    function<void(int)> dfs = [&](int cur) {
        sz[cur] = 1;
        for (int nxt : adj[cur]) {
            dep[nxt] = dep[cur] + 1;
            dfs(nxt);
            sz[cur] += sz[nxt];
        }
    };
    dfs(0);
    int depmax = *max_element(dep.begin(), dep.end());

    vector<pair<int, vector<int>>> depcnt_idx(depmax + 1);
    for (int i = 0; i < n; i++) {
        depcnt_idx[dep[i]].fr++;
        depcnt_idx[dep[i]].sc.push_back(i);
    }
    sort(depcnt_idx.begin(), depcnt_idx.end());

    vector<pair<int, vector<vector<int>>>> depcnt_values;
    for (auto [cnt, vec] : depcnt_idx) {
        assert(cnt != 0);
        assert(cnt == (int)vec.size());
        if (depcnt_values.empty() || depcnt_values.back().fr != cnt) {
            depcnt_values.emplace_back(cnt, vector<vector<int>>{});
        }
        depcnt_values.back().sc.push_back(vec);
    }
    /*for (auto [cnt, vvec] : depcnt_values) {
        cout << cnt << '\n';
        for (auto vec : vvec) {
            for (auto idx : vec) cout << idx << ' ';
            cout << '\n';
        }
        cout << '\n';
    }*/

    vector<int> freq(depcnt_values.size());
    for (int i = 0; i < (int)freq.size(); i++) {
        freq[i] = depcnt_values[i].sc.size();
    }

    vector<vector<int>> dp(x + 1, vector<int>(freq.size() + 1)),
        parent(n, vector<int>(freq.size() + 1));
    ;
    dp[0][0] = 1;
    for (int j = 0; j < (int)freq.size(); j++) {
        int val = depcnt_values[j].fr;
        int fre = freq[j];
        // cout << val << ' ' << fre << '\n';
        vector<int> existmod(val, -1);
        for (int i = 0; i <= x; i++) {
            if (dp[i][j] == 1) existmod[i % val] = i;
            if (existmod[i % val] == -1 ||
                (i - existmod[i % val]) / val > fre) {
                dp[i][j + 1] = false;
            } else {
                dp[i][j + 1] = true;
                parent[i][j + 1] = (i - existmod[i % val]) / val;
            }
        }
        // for (int i = 0; i <= x; i++) cout << dp[i][j + 1] << " \n"[i == x];
    }

    /*for (int j = 0; j < (int)freq.size(); j++) {
        for (int i = 0; i <= x; i++) cout << parent[i][j + 1] << " \n"[i == x];
    }*/

    if (dp[x][(int)freq.size()]) {
        string ans(n, b.sc);
        cout << depmax + 1 << '\n';
        int i = x, j = (int)freq.size();
        while (i != 0) {
            assert(j > 0);
            int val = depcnt_values[j - 1].fr;
            vector<vector<int>> &vvec = depcnt_values[j - 1].sc;
            int use = parent[i][j];
            i -= use * val;
            j--;
            while (use--) {
                assert(!vvec.empty());
                auto vec = vvec.back();
                for (int idx : vec) {
                    // cout << idx << ' ';
                    ans[idx] = a.sc;
                }
                // cout << '\n';
                vvec.pop_back();
            }
        }
        cout << ans << '\n';
        return;
    }
    string ans(n, '?');
    cout << depmax + 2 << '\n';
    for (int h = 0; h <= depmax; h++) {
        vector<int> &vec = depcnt_idx[h].sc;
        int cnt = depcnt_idx[h].fr;

        sort(vec.begin(), vec.end(),
             [&](const int &a, const int &b) { return sz[a] > sz[b]; });
        if (a.fr < b.fr) swap(a, b);
        assert(a.fr != 0);
        for (int idx : vec) {
            if (a.fr == 0) swap(a, b);
            ans[idx] = a.sc;
            a.fr--;
        }
    }
    cout << ans << '\n';
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int t;
    t = 1;
    // cin >> t;
    while (t--) solve();

    return 0;
}