import java.util.Scanner;
import java.io.PrintStream;
public class Mainnn {
public static void main(String[] args) throws java.io.UnsupportedEncodingException {
PrintStream ps = new PrintStream(System.out, true, "UTF-8");
Scanner in = new Scanner(System.in, "UTF-8");
int kuan;
int gao;
kuan = in.nextInt();
gao = in.nextInt();
int[][]a = new int[gao][kuan];
for (int i =gao-1; i>0; i--) {
for (int j =0; j<kuan; j++) {
a[i][j] = in.nextInt();
}
}
for (int m = 0; m < gao; m++) {
for (int n = 0; n < kuan; n++) {
if (a[m][n] == 0) {
ps.print(" ");
} else if (a[m][n] == 1) {
ps.print("*");
}
}
ps.println();
}
}
}