#include <iostream>
using namespace std;
int main()
{
size_t sz,i;
for(cin>>sz,i=sz*sz;;(sz>=3)&&(i--);cout<<'#'<<(i%sz?"":"\n"))
{
if(!i) cin>>sz,i=sz*sz;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSAKewoJc2l6ZV90IHN6LGk7Cglmb3IoY2luPj5zeixpPXN6KnN6Ozsoc3o+PTMpJiYoaS0tKTtjb3V0PDwnIyc8PChpJXN6PyIiOiJcbiIpKQoJewoJCWlmKCFpKSBjaW4+PnN6LGk9c3oqc3o7Cgl9CglyZXR1cm4gMDsKfQ==