<?php
while (true) {
list($height, $width) = getSpacesByExplodeTrimInput();

    for($i = 1; $i <= $height; $i++){
        if ($i % 2 == 0) {
                $lines[] = setEvenNumLine($width);
            }else{
                $lines[] = setOddNumLine($width);
            }
    }
}
    echo implode($lines), PHP_EOL;

function setEvenNumLine($width)
{
    $line = "";
    for ($i = 1; $i <= $width; $i++) {
        $line .= $i % 2 == 0 ? "#" : ".";
    }
    return $line.PHP_EOL;
}

function setOddNumLine($width)
{
    $line = "";
    for ($i = 1; $i <= $width; $i++) {
        $line .= $i % 2 == 0 ? "." : "#";
    }
    return $line.PHP_EOL;
}