// (C) Timofey S. Chistyakov 2005

{$apptype console}

uses
  Types, Math, SysUtils;

  procedure Fill(var S: string; Ch: char; From, Cnt: integer);
  var
    i: integer;
  begin
    for i := 1 to Cnt do
      S[From + i - 1] := Ch;
  end;

var
  i, n, t, l: integer;
  m: TStringDynArray;
begin
  n := StrToInt(ParamStr(1));
  t := StrToInt(ParamStr(2));
  n := n + (3 - n mod 4);
  n := EnsureRange(n, 7, 999);

  SetLength(m, n);
  for i := 0 to n - 1 do
    m[i] := StringOfChar('a', n);

  m[0, n - 1] := 'A';
  m[0, n] := '.';

  Fill(m[1], '#', 2, n - 2);
  l := 2;
  for i := 1 to (n - 3) div 4 do begin
    m[l, n - 1] := '#';
    Inc(l);
    Fill(m[l], '#', 1, n - 3);
    m[l, n - 1] := '#';
    Inc(l);
    m[l, n - 1] := '#';
    Inc(l);
    Fill(m[l], '#', 2, n - 2);
    Inc(l);
  end;

  WriteLn(n, ' ', t);
  for i := 0 to n - 1 do
    WriteLn(m[i]);
end.
