package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os"
	"strconv"
)

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbefferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial
}

// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Simple math functions

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func abs64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

var counter int

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	counter++
	return gcd(b, a%b)
}

func gcd64(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return gcd64(b, a%b)
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	// SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()

	A := readi()
	B := readi()

	f := solve(A, B)
	println(len(f), len(f[0]))
	for i := range f {
		println(string(f[i]))
	}
}

func main0() {
	defer Flush()
	for A := 1; A <= 500; A++ {
		for B := 1; B <= 500; B++ {
			f := solve(A, B)
			if !check(f, A, B) {
				println("NG", A, B)
				for i := range f {
					println(string(f[i]))
				}
				return
			}
		}
	}
}

func solve(A, B int) [][]byte {
	H := 50
	W := 100
	f := make([][]byte, H)
	for i := range f {
		f[i] = make([]byte, W)
		for j := range f[i] {
			if j == 0 {
				f[i][j] = '#'
			} else if j == W-1 {
				f[i][j] = '.'
			} else if i%2 == 0 {
				f[i][j] = '.'
			} else {
				f[i][j] = '#'
			}
		}
	}

	i := 0
	j := 2
	for k := 1; k < A; k++ {
		f[i][j] = '#'
		j += 2
		if W-1 <= j {
			j = 2
			i += 2
		}
	}

	i = H - 1
	j = W - 3
	for k := 1; k < B; k++ {
		f[i][j] = '.'
		j -= 2
		if j < 1 {
			j = W - 3
			i -= 2
		}
	}

	return f
}

func check(f [][]byte, A, B int) bool {
	visited := make([][]bool, len(f))
	for i := range visited {
		visited[i] = make([]bool, len(f[i]))
	}

	dx := []int{0, 1, 0, -1}
	dy := []int{1, 0, -1, 0}

	var dfs func(c byte, i, j int)
	dfs = func(c byte, i, j int) {
		visited[i][j] = true
		for k := range dx {
			nx, ny := j+dx[k], i+dy[k]
			if nx < 0 || len(f[0]) <= nx || ny < 0 || len(f) <= ny || visited[ny][nx] || f[ny][nx] != c {
				continue
			}
			dfs(c, ny, nx)
		}
	}

	w, b := 0, 0
	for i := range f {
		for j := range f[i] {
			if visited[i][j] {
				continue
			}
			if f[i][j] == '.' {
				w++
				dfs('.', i, j)
			} else {
				b++
				dfs('#', i, j)
			}
		}
	}
	return w == A && b == B
}


Measured memory_bytes: 640