Under construction

Still being built. Things may change

Frames

Interview

Time limit1sMemory limit1024 MB

Summary
Draw n rectangle borders on an h by w grid in input order, marking the i-th frame with the i-th letter, and print the final picture.
Level

Easy3 of 10

Topics
Implementation, Simulation
Solved
No attempts yet

Statement

Senya decided to write an operating system. To start, he plans to write a subroutine that draws window frames.

The drawing field is a rectangle of h×wh \times w pixels. Rows are numbered from 1 to hh from top to bottom, and columns are numbered from 1 to ww from left to right.

The nn frames are drawn on the field one after another. The ii-th frame is the border of a rectangle with opposite corners at (ri,1,ci,1)(r_{i,1}, c_{i,1}) and (ri,2,ci,2)(r_{i,2}, c_{i,2}).

Input

The first line contains integers hh, ww, and nn, the field size and the number of frames (2≤h,w≤802 \le h, w \le 80, 1≤n≤261 \le n \le 26). Each of the next nn lines contains four integers ri,1r_{i,1}, ci,1c_{i,1}, ri,2r_{i,2}, and ci,2c_{i,2} (1≤ri,1<ri,2≤h1 \le r_{i,1} < r_{i,2} \le h, 1≤ci,1<ci,2≤w1 \le c_{i,1} < c_{i,2} \le w).

Output

Print the image produced by the frames described in the input as hh rows of ww characters each. A pixel not used by any frame is printed as .. A pixel of the ii-th frame is printed with the ii-th Latin letter, so the first frame uses a, the second uses b, and so on.

Examples1

  1. Example 1

    Input
    9 10 2
    1 1 7 8
    3 3 4 9
    
    Expected output
    aaaaaaaa..
    a......a..
    a.bbbbbbb.
    a.bbbbbbb.
    a......a..
    a......a..
    aaaaaaaa..
    ..........
    ..........