#!/usr/bin/env ruby

word = [];numbers = [];codes =[]
i = 0
sharp = "#";dot = "."
loop do 
    word = gets.split.map(&:to_i)
    if word[0] == 0 and word[1] == 0 then; break; end
    word.each do |key|
        numbers << key
    end
end

((numbers.count + 1) / 2).times do 
    numbers[i].times do |loopindex|
        case loopindex % 2 
        when 0 then
            numbers[i + 1].times do |count| 
                case count % 2
                when 0 then
                    codes << sharp
                when 1 then
                    codes << dot
                end
            end
        when 1 then
            numbers[i + 1].times do |count|
                case count % 2
                when 1 then
                    codes << sharp
                when 0 then
                    codes << dot
                end
            end
        end
        codes.each do |value|
            print value
        end
        codes.clear
        puts ""
    end
    i += 2
    puts ""
end
