#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<cmath>
#include<cctype>
#include<algorithm>
using namespace std;
int a[100005];
int main(){
int n, m;
cin >> n >> m;
int i, j;
for(i = 0; i < n; i++) {
cin >> a[i];
int x = m;
if(x >= 5)
a[i] = 100;
else{
while(x--) {
a[i] = ceil(sqrt(double(a[i]))) * 10;
}
}
}
for(i = 0; i < n; i++){
cout << a[i];
if(i != n - 1)
cout << " ";
else
cout << endl;
}
return 0;
}