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 long double ld;
typedef unsigned long long ull;
#define rint register int
#define rll register ll 
#define pii pair<int, int>
#define pll pair<ll, ll>
//#define p1 first
//#define p2 second
#define fors(i, a, b) for (ll i = (a); i <= (b); ++i)
#define pb push_back
#define mem(A, b) memset(A, b, sizeof(A))
static struct FastInput {
  static constexpr int BUF_SIZE = 1 << 20;
  char buf[BUF_SIZE];
  size_t chars_read = 0;
  size_t buf_pos = 0;
  FILE *in = stdin;
  char cur = 0;
 
  inline char get_char() {
    if (buf_pos >= chars_read) {
      chars_read = fread(buf, 1, BUF_SIZE, in);
      buf_pos = 0;
      buf[0] = (chars_read == 0 ? -1 : buf[0]);
    }
    return cur = buf[buf_pos++];
  }
 
  inline void tie(int) {}
 
  inline explicit operator bool() {
    return cur != -1;
  }
 
  inline static bool is_blank(char c) {
    return c <= ' ';
  }
 
  inline bool skip_blanks() {
    while (is_blank(cur) && cur != -1) {
      get_char();
    }
    return cur != -1;
  }
 
  inline FastInput& operator>>(char& c) {
    skip_blanks();
    c = cur;
    return *this;
  }
  
  inline FastInput& operator>>(string& s) {
    if (skip_blanks()) {
      s.clear();
      do {
        s += cur;
      } while (!is_blank(get_char()));
    }
    return *this;
  }
 
  template <typename T>
  inline FastInput& read_integer(T& n) {
    // unsafe, doesn't check that characters are actually digits
    n = 0;
    if (skip_blanks()) {
      int sign = +1;
      if (cur == '-') {
        sign = -1;
        get_char();
      }
      do {
        n += n + (n << 3) + cur - '0';
      } while (!is_blank(get_char()));
      n *= sign;
    }
    return *this;
  }
 
  template <typename T>
  inline typename enable_if<is_integral<T>::value, FastInput&>::type operator>>(T& n) {
    return read_integer(n);
  }
  
  #if !defined(_WIN32) || defined(_WIN64)
  inline FastInput& operator>>(__int128& n) {
    return read_integer(n);
  }
  #endif
 
  template <typename T>
  inline typename enable_if<is_floating_point<T>::value, FastInput&>::type operator>>(T& n) {
    // not sure if really fast, for compatibility only
    n = 0;
    if (skip_blanks()) {
      string s;
      (*this) >> s;
      sscanf(s.c_str(), "%lf", &n);
    }
    return *this;
  }
} fast_input;
 
#define cin fast_input
 
static struct FastOutput {
  static constexpr int BUF_SIZE = 1 << 20;
  char buf[BUF_SIZE];
  size_t buf_pos = 0;
  static constexpr int TMP_SIZE = 1 << 20;
  char tmp[TMP_SIZE];
  FILE *out = stdout;
 
  inline void put_char(char c) {
    buf[buf_pos++] = c;
    if (buf_pos == BUF_SIZE) {
      fwrite(buf, 1, buf_pos, out);
      buf_pos = 0;
    }
  }
 
  ~FastOutput() {
    fwrite(buf, 1, buf_pos, out);
  }
 
  inline FastOutput& operator<<(char c) {
    put_char(c);
    return *this;
  }
 
  inline FastOutput& operator<<(const char* s) {
    while (*s) {
      put_char(*s++);
    }
    return *this;
  }
 
  inline FastOutput& operator<<(const string& s) {
    for (int i = 0; i < (int) s.size(); i++) {
      put_char(s[i]);
    }
    return *this;
  }
 
  template <typename T>
  inline char* integer_to_string(T n) {
    // beware of TMP_SIZE
    char* p = tmp + TMP_SIZE - 1;
    if (n == 0) {
      *--p = '0';
    } else {
      bool is_negative = false;
      if (n < 0) {
        is_negative = true;
        n = -n;
      }
      while (n > 0) {
        *--p = (char) ('0' + n % 10);
        n /= 10;
      }
      if (is_negative) {
        *--p = '-';
      }
    }
    return p;
  }
 
  template <typename T>
  inline typename enable_if<is_integral<T>::value, char*>::type stringify(T n) {
    return integer_to_string(n);
  }
 
  #if !defined(_WIN32) || defined(_WIN64)
  inline char* stringify(__int128 n) {
    return integer_to_string(n);
  }
  #endif
 
  template <typename T>
  inline typename enable_if<is_floating_point<T>::value, char*>::type stringify(T n) {
    sprintf(tmp, "%.17f", n);
    return tmp;
  }
 
  template <typename T>
  inline FastOutput& operator<<(const T& n) {
    auto p = stringify(n);
    for (; *p != 0; p++) {
      put_char(*p);
    }
    return *this;
  }
} fast_output;

#define cout fast_output
#define endl '\n'
const int _ = 1e5 + 2;
const int sqr = 450;

int n, x;
vector<int> lik[_];
int d[_];
int max_d;
int nd[_];
int kin[_];
vector<int> able;
int cnt[sqr][_];
int siz;
int kind[_];
char ch[_];
vector<int> q[_];

void dfs(int u, int fa) {
  for (auto v : lik[u]) {
    if (v != fa) {
      d[v] = d[u] + 1;
      dfs(v, u);
    }
  }
  return ;
}

//出现次数kin[able[i]]
//键值able[i]
bool getdp(int i, int j) {
  if (cnt[i][j] != -1) return cnt[i][j] >= 0;
  cnt[i][j] = -2;
  if (i == siz - 1) {
    if (j % able[i] || j / able[i] > kin[able[i]]) return false;
    cnt[i][j] = j / able[i];
    return true; 
  }
  fors(k, 0, kin[able[i]]) {
    if (j < 1LL * k * able[i]) break;
    if (getdp(i+1, j-k*able[i])) {
      cnt[i][j] = k;
      return true;
    }
  }
  return false;
}

int na, nb;

signed main() {  
  //freopen("in.txt", "r", stdin);
  //freopen("out.txt", "w", stdout);
  ios::sync_with_stdio(false);
  cin.tie(0);
  int start_time = clock();
  mem(cnt, -1);
  cin >> n >> x;
  fors(i, 2, n) {
    int pa;
    cin >> pa;
    lik[pa].pb(i);
    lik[i].pb(pa);
  }
  dfs(1, -1);
  fors(i, 1, n) nd[d[i]]++;
  fors(i, 1, n) max_d = max(max_d, d[i]);
  fors(i, 0, max_d) kin[nd[i]]++;
  fors(i, 1, n) if (kin[i]) able.pb(i);
  siz = able.size();
  if (x == n) {
    cout << max_d + 1 << endl;
    fors(i, 1, n) cout << 'a';
    cout << endl;
    return 0;
  }
  if (x == n-1) {
    cout << max_d + 1 << endl;
    cout << 'b';
    fors(i, 2, n) cout << 'a';
    cout << endl;
    return 0;
  }
  if (getdp(0, x)) {
    cout << max_d + 1 << endl;
    int now = x;
    fors(i, 0, n) kin[i] = 0;
    fors(i, 0, siz - 1) {
      kin[able[i]] = cnt[i][now];
      now -= cnt[i][now] * able[i];
    }
    fors(i, 0, max_d) {
      if (kin[nd[i]]) { kind[i] = 1; kin[nd[i]]--; }
    }
    fors(i, 1, n) {
      kind[d[i]] ? cout << 'a' : cout << 'b';
    }
    cout << endl;
  }
  else {
    cout << max_d + 2 << endl;
    na = x, nb = n - x;
    fors(i, 1, n) {
      q[d[i]].pb(i);
    }
    fors(i, 0, max_d) {
      if (nd[i] <= na) {
        for (auto v : q[i]) ch[v] = 'a';
        na -= nd[i];
      }
      else if (nd[i] <= nb) {
        for (auto v : q[i]) ch[v] = 'b';
        nb -= nd[i];
      }
      else {
        if (na >= nb) {
          for (auto v : q[i]) {
            if (lik[v].size() > 1) { ch[v] = 'a'; na--; }
          }
          for (auto v : q[i]) {
            if (lik[v].size() == 1) { 
              if (na) { ch[v] = 'a'; na--; }
              else { ch[v] = 'b'; nb--; }  
            }
          }
        }
        else {
          for (auto v : q[i]) {
            if (lik[v].size() > 1) { ch[v] = 'b'; nb--; }
          }
          for (auto v : q[i]) {
            if (lik[v].size() == 1) { 
              if (nb) { ch[v] = 'b'; nb--; }
              else { ch[v] = 'a'; na--; }  
            }
          }
        }
      }
    }
    fors(i, 1, n) cout << ch[i];
    cout << endl;
  }
  //cout << "time = " << clock() - start_time << endl;
  return 0;
}