#include
#include
int main(int argc, char* argv[])
{
int j,s;
int k,x;
int y;
int n = argc > 1 ? atoi(argv[1]) : 4;
for ( j = 1; j <= n; j++) {
s = 1 << j, k = (1 << n) - s, x;
for ( y = s - j; y >= 0; y--, putchar('\n')) {
for (x = 0; x < y + k; x++) printf(" ");
for (x = 0; x + y < s; x++) printf("%c ", '!' ^ y & x);
for (x = 1; x + y < s; x++) printf("%c ", '!' ^ y & (s - y - x - 1));
}
}
}