use std::io::{stdin, Read};

fn main() {
    let mut stdin = stdin();
    let mut buf = String::new();
    stdin.read_to_string(&mut buf).unwrap();

    let mut cycle = 0;
    let mut lines = buf.split("\n");
    let mut total = 0;
    let mut x = 1;
    let mut to_add = 0;
    
    while cycle < 240 {
        for row in 0..40 {
            cycle += 1;
            // during cycle

            // if (cycle - 20) % 40 == 0 { // day 1 // day 1
            //     total += cycle * x;
            // }
            let diff = row - x;
            if diff < -1 || diff > 1 {
                print!(".");
            } else {
                print!("#");
            }

            // after cycle
            if to_add != 0 {
                x += to_add;
                to_add = 0;
            } else {
                let line = lines.next().unwrap();
                match line.chars().next().unwrap() {
                    'n' => {}
                    'a' => {
                        to_add = line[5..].parse::<i32>().unwrap();
                    }
                    _ => { panic!("????"); }
                }
            }
        }
        println!(); // day 2
    }
    // println!("{}", total); // day 1
}