The input is a sequence of datasets each in the following format.
w h p
image data
pattern data
The first line of a dataset consists of three positive integers w, h and p. w is the width of the image and h is the height of the image. Both are counted in numbers of bits. p is the width and height of the pattern. The pattern is always square-shaped. You may assume 1 ≤ w ≤ 1000, 1 ≤ h ≤ 1000, and 1 ≤ p ≤ 100.
The following h lines give the image. Each line consists of 「w/6┐ (which is equal to └(w+5)/6┘ characters, and corresponds to a horizontal line of the image. Each of these characters represents six bits on the image line, from left to right, in a variant of the BASE64 encoding format. The encoding rule is given in the following table. The most significant bit of the value in the table corresponds to the leftmost bit in the image. The last character may also represent a few bits beyond the width of the image; these bits should be ignored.
character value (six bits)
A–Z 0–25
a–z 26–51
0–9 52–61
+ 62
/ 63
The last p lines give the pattern. Each line consists of 「p/6┐ characters, and is encoded in the same way as the image.
A line containing three zeros indicates the end of the input. The total size of the input does not exceed two megabytes.