Types: d: int, w: int, e: List[List[int]]
Ranges: 3 ≤ d ≤ 10, 3 ≤ w ≤ 10, 0 ≤ e[x][y] ≤ 9
Addtl Info: Input consists of at most 100 datasets. The end of the input is indicated by a line containing two zeros separated by a space.