#include <stdio.h>

int
main (int argc, char **argv) {
  int i;
  int l, r, t, b;
  int w, h;
  int s;
  int lm, rm, tm, bm;

  if (argc < 3)
    {
      fprintf (stderr, "usage: brute width height\n");
      exit (1);
    }
  w = atoi (argv[1]);
  h = atoi (argv[2]);
  s = w * h;
  tm = (1 << (s - w)) - 1;
  bm = (1 << s) - (1 << w);
  lm = (1 << s) - 1 ;
  rm = (1 << s) - 1;
  for (i = 0; i < h; i++)
    {
      lm -= 1 << (w * i + w - 1);
      rm -= 1 << (w * i);
    }

  for (i = 0; i < (1 << s); i++)
    {
      l = (i & lm) << 1;
      r = (i & rm) >> 1;
      t = (i & tm) << w;
      b = (i & bm) >> w;
      if ((i ^ l ^ r ^ t ^ b) == (1 << s) - 1)
	{
	  int j;
	  for (j = 0; j < s; j++)
	    {
	      printf ("%c ", (i & (1 << j)) ? '#' : '.');
	      if (j % w == (w - 1))
		printf ("\n");
	    }
	  printf ("\n");
	}
    }
  return 0;
}
