import std.stdio;
import std.string;
import std.conv;

void main()
{
    auto line = chomp(readln()).split(" ");
    int H = to!int(line[0]),
        W = to!int(line[1]);
    while(H || W)
    {
        foreach(int i; 0 .. H)
        {
            writeln(repeat("#", W));
        }
        writeln();
        line = chomp(readln()).split(" ");
        H = to!int(line[0]);
        W = to!int(line[1]);
    }
}

string repeat(string s, int n)
{
    string r;
    while(n)
    {
        if(n % 2)
        {
            r ~= s;
        }
        n >>= 1;
        s ~= s;
    }
    return r;
}