def main(): H, W = map(int, raw_input().split()) N = input() R = range(N) H, W = H-1, W-1 S = [] K = [] c = 0 while c