# def digitSum(n):
# ans = 0
# while n:
# ans += n % 10
# n //= 10
# return ans
# class Solution:
# def movingCount(self, m: int, n: int, k: int) -> int:
# from queue import Queue
# q = Queue()
# q. put((0, 0))
# path = set()
# while not q.empty():
# x, y = q.get_nowait()
# if (x, y) not in path and 0 <= x < m and 0 <= y < n and digitSum(x) + digitSum(y) <= k:
# path.add((x, y))
# for nx, ny in [(x + 1, y), (x, y + 1)]:
# q.put((nx, ny))
# return len(path)