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 <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <vector>
#include <unordered_map>
using namespace std;

const int N = 100007, M = 500007, INF = 0x3f3f3f3f;

typedef long long ll;
typedef int itn;

int n, m, t, x;
int fa[N];
int deep[N];
int maxx;
int num[N];//每一层结点个数
int cnt;
int lson[N];//叶子节点
int head[N], ver[M], edge[M], nex[M], tot;
bitset<N> f[2007];//能否凑齐 x，使用 bitset 优化
int val[N];
unordered_map<int, int> vis;
//int vis[N];
bool ok[N];
vector<int> v[N];

void add(int x, itn y)
{
	ver[tot] = y;
	nex[tot] = head[x];
	head[x] = tot ++ ;
}

void dfs1(int x)
{
	deep[x] = deep[fa[x]] + 1;//这里根结点 deep[1] = 1 所以不用再 +1 了
	num[deep[x]] ++ ;
	maxx = max(maxx, deep[x]);//树的直径，实际上也就是最大深度
	if (head[x] == -1) //没有子节点，说明是叶子结点
		lson[deep[x]] ++ ;//每层的叶子结点个数
	for (int i = head[x]; ~i; i = nex[i]) {
		int y = ver[i];
		dfs1(y);
	}
}

void dfs2(itn x, int t)
{
	if(x == 0)
		return;
	for (int i = 0; i < (int)v[x].size(); ++ i) {
		if(val[x] > t || f[x - 1][t])
			break;
		t -= val[x], ok[v[x][i]] = true;
	}
	dfs2(x - 1, t);
}

void init()
{
    memset(head, -1, sizeof head);
    tot = 0;
}

void solve()
{
    init();
	scanf("%d%d", &n, &x);
	for (int i = 2; i <= n; ++ i) {
		scanf("%d", &fa[i]);
		//add(i, fa[i]);
		add(fa[i], i);
	}
	dfs1(1);//预处理每层结点个数
	//把抽象的树转化为一个个物品，存到 v 里，离散化一下，种类（结点个数）和个数（层数）
	//cout << "ok" << endl;
	//一共cnt种，
	for (int i = 1; i <= maxx; ++ i) {
		if (vis[num[i]]) {
           v[vis[num[i]]].push_back(i);
		}
		else {
            vis[num[i]] = ++ cnt;
            val[cnt] = num[i];
            v[cnt].push_back(i);//来找最后选了第几层
		}
	}

	f[0][0] = 1;

    for (int i = 1; i <= cnt; ++ i) {
        f[i] = f[i - 1];
		itn Size = v[i].size();
		for (int j = 1; j <= Size; j <<= 1) {
			Size -= j;
			f[i] |= (f[i] << (j * val[i]));
		}
		if(Size > 0)
			f[i] |= f[i] << (Size * val[i]);
	}

	if(f[cnt][x]) {
		printf("%d\n", maxx);
		dfs2(cnt, x);//还原dp的方案
		for (int i = 1; i <= n; ++ i) {
			putchar(ok[deep[i]] ? 'a' : 'b');
		}
	}
	//凑不齐，'a' 有剩余
	else {
		int res = INF;
		for (int i = x; i >= 0; -- i) {
			if(f[cnt][i]) {
				res = i;//找到能凑到的最大的数
				break;
			}
		}
		dfs2(cnt, res);
		int pos = -1;
		for (int i = 1; i <= maxx; ++ i)
		{
			if(!ok[i] && lson[i] >= x - res) {
				pos = i;
				break;
			}
		}

		printf("%d\n", maxx + 1);

		for (int i = 1; i <= n; ++ i) {
			if(deep[i] == pos && head[i] == -1) {
				if(res == x) {
					putchar('b');
				}
				else
					putchar('a'), ++ res;
			}
			else {
				putchar(ok[deep[i]] ? 'a' : 'b');
			}
		}
	}
	return ;
}

itn main()
{
    solve();
	return 0;
}