There are multiple test cases.
The first line contains a case number t.
For each case, the first line contains three integers. The size of the minefield , n (2<n<10) and m (2<m<10), the total number of the mines buried in the minefield k(1<k<=10).
The next n lines contains m characters which describe the situation of the minefield. Each character corresponds to a region. The character '#' means the region is unknown, otherwise it is '0 '~ '8', showing the detector results in this region. The input data are legitimate, which means the results of detectors are accurate and reliable.