Repeater Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4187 Accepted: 1114 Description Harmony is indispensible in our daily lifeand no one can live without it----may be Facer is the only exception. One dayit is rumored that repeat painting will create harmony and then hundreds ofpeople started their endless drawing. Their paintings were based on a smalltemplate and a simple method of duplicating. Though Facer can easily imaginethe style of the whole picture, but he cannot find the essential harmony. Nowyou need to help Facer by showing the picture on computer. You will be given a template containingonly one kind of character and spaces, and the template shows how the endlesspicture is created----use the characters as basic elements and put them in theright position to form a bigger template, and then repeat and repeat doingthat. Here is an example.
# # # <-template # # So the Level 1 picture will be
# # # # # Level 2 picture will be
# # ## # # # # ## ## # ## # # ## # # # # ##
Input The input contains multiple test cases. Thefirst line of each case is an integer N, representing the size of the template is N*N (N could only be 3, 4 or 5). Next Nlines describe the template. Thefollowing line contains an integer Q, which is the Scale Level of the picture. Inputis ended with a case of N=0. It isguaranteed that the size of one picture will not exceed 3000*3000. Output For each test case, just print the Level Q picture by using the given template.
Sample Input 3 # # # # # 1 3 # # # # # 3 4 OO O O O O OO 2 0 Sample Output # # # # # # # ## ## ## # # # # # # ## ## ## ## ## # # ## ## # # ## ## ## # # # # # # ## ## ## ## ## # # ## ## ## # ## ## ## # # ## ## # # ## ## ## # # # # # # ## ## ## ## ## # # ## ## # # ## ## ## # # # # # # ## ## ## OO OO O OO O O OO O OO OO OO OO O O O O O O O O OO OO OO OO O O O O O O O O OO OO OO OO O OO O O OO O OO OO