#include<bits/stdc++.h>
using namespace std;
const int maxn = 300050;
int n,k;
double a[maxn];
int change(double x,int pos){
int num;
for(int i = 1 ; i <= k ; i++){
num = sqrt(x) + 0.9999999;
x = num * 10;
if(x == 100) break;
}
return x;
}
int main(){
cin>>n>>k;
for(int i = 1 ; i <= n ; i++){
scanf("%lf",&a[i]);
a[i] = change(a[i],i);
}
for(int i = 1 ; i <= n ; i++){
printf("%.0lf",a[i]);
if(i == n) printf("\n");
else printf(" ");
}
return 0;
}