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 ll   long long
#define ull  long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
const ll maxn =1e5+100;
const ll mod=998642767 ;
const ll base=317;

vector<ll> adj[maxn];
ll dep[maxn];
vector<ll> gr[maxn];
vector<ll> gr1[maxn];

ll mx=-1;
ll dp[maxn][2];
void dfs(ll u,ll par)
{
    mx=max(mx,dep[u]);
    gr[dep[u]].pb(u);
   for (auto to:adj[u])
   {
       dep[to]=dep[u]+1;
       dfs(to,u);
   }
}
ll cntnw[maxn];
ll gtx[maxn];
char res[maxn];
ll pos[maxn];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    if (fopen("TRIPLES.inp","r"))
    {
        freopen("TRIPLES.inp","r",stdin);
        freopen("TRIPLES.out","w",stdout);
    }
   ll n, x;
    cin>>n>> x;
    for (int i=2;i<=n;i++)
    {
        ll x;
         cin>>x;
       adj[x].pb(i);
    }
    dep[1]=1;
    dfs(1,0);
    vector<ll> vt;
    for (int i=1;i<=mx;i++)
    {
        vt.pb(gr[i].size());
    //    cout <<gr[i].size()<<endl;
        gr1[gr[i].size()].pb(i);
    }
    sort(vt.begin(),vt.end());
    dp[0][0]=1;
    ll pre=0;
    for (int i=0;i<vt.size();i++)
    {
       ll j=i;
       while (j<vt.size()&&vt[j]==vt[i])
       {
           j++;
       }
       j--;
       ll nw=1-pre;
       ll cnt=(j-i+1);
       ll t=vt[j];
       //cout <<t<<" "<<cnt<<" "<<nw<<endl;
       for (ll i=0;i<=n;i++)
       {
          cntnw[i%t]+=dp[i][pre];
         // cout <<dp[i][pre]<<endl;
          //  cout <<cntnw[i%t]<<endl;
          if (i>=(cnt+1)*t) cntnw[i%t]-=dp[i-(cnt+1)*t][pre];
          // cout <<cntnw[i%t]<<endl;
          if (cntnw[i%t]) dp[i][nw]=1;
          if (!dp[i][pre]&&dp[i][nw]) gtx[i]=t;
       }
       for (int i=0;i<=n;i++) dp[i][pre]=0;
     /*  for (int i=0;i<=n;i++) cout <<dp[i][nw]<<" ";
       cout <<endl;*/
       for (int t=0;t<=vt[j];t++) cntnw[t]=0;
       i=j;
       pre=nw;
    }
  /*  for (int i=0;i<=n;i++)
    {
        cout <<dp[i][pre]<<endl;
    }*/
    for (int i=1;i<=n;i++) res[i]='b';
    if (dp[x][pre])
    {
       //  cout <<"WTF"<<endl;
        cout <<mx<<endl;
        while (x)
        {
            ll h=gtx[x];
            ll cnt=0;
            while (1)
            {
                cnt++;
                x-=h;
                if (dp[x][pre]) break;
            }
            for (int i=pos[h];i<pos[h]+cnt;i++)
            {
                ll t=gr1[h][i];
                for (auto to:gr[t]) res[to]='a';
            }
            pos[h]+=cnt;
          //  cout <<cnt<<" "<<h<<endl;
        }
        for (int i=1;i<=n;i++) cout <<res[i];
    }
    else
    {
      //  cout <<"WTF"<<endl;
        cout <<mx+1<<endl;
        vector<ll> remain;
        ll nw=n;
        vector<ll> vt1;
        for (int i=1;i<=mx;i++)
        {
             if (x>=gr[i].size())
             {
                 for (auto to:gr[i]) res[to]='a';
                 x-=gr[i].size();
                 nw-=gr[i].size();
             }
             else if (nw-x>=gr[i].size())
             {
                 nw-=gr[i].size();
             }
             else
             {
                 vector<ll> vt;

                  for (auto to:gr[i])
                  {
                      if (adj[to].size()) vt.pb(to);
                      else vt1.pb(to);
                  }
                  if (x>=vt.size())
                  {
                      for (auto to:vt) res[to]='a';
                      x-=vt.size();
                  }
                  else
                  {

                  }
                  nw-=vt.size();
             }
        }
        for (auto to:vt1)
        {
            if (x)
            {
                x--;
                res[to]='a';
            }
        }
        for (int i=1;i<=n;i++) cout <<res[i];
    }





}