#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=100010;
const int inf =0x3f3f3f3f;
int n,m,k,t;
int a[maxn];
char ch[maxn];
int ji(int x)
{
int t=sqrt((double)x);
if(t==sqrt((double)x))
return 10*t;
return 10*(t+1);
}
int main()
{
scanf("%d %d",&n,&k);
for(int i=1;i<=n;++i)
{
scanf("%d",&a[i]);
}
if(k<5){
for(int i=1;i<=n;++i)
{
for(int j=1;j<=k;++j)
a[i]=ji(a[i]);
if(i!=1)
printf(" ");
printf("%d",a[i]);
}
}
else
{
for(int i=1;i<=n;++i)
{
if(i!=1)
printf(" ");
printf("100");
}
}
printf("\n");
}