mod = 998244353 # Precompute ways[s] = number of pairs (a, b) with a + b = s and 0 <= a, b <= 9 ways = [0] * 19 for s in range(19): if s <= 9: ways[s] = s + 1 else: ways[s] = 19 - s def comb(n, k): if n < k or k < 0: return 0 res = 1 for i in range(k): res = res * (n - i) // (i + 1) return res % mod def compute_case(W, H, X): if X < 0 or X > 81: return 0 if H == 1 and W == 1: return 1 if 0 <= X <= 9 else 0 elif H == 1 and W == 2: return ways[X] % mod if X <= 18 else 0 elif H == 2 and W == 2: total = comb(X + 3, 3) total -= 4 * comb(X - 10 + 3, 3) total += 6 * comb(X - 20 + 3, 3) total -= 4 * comb(X - 30 + 3, 3) total += comb(X - 40 + 3, 3) total %= mod return max(total, 0) % mod elif H == 2 and W % 2 == 1: m = (W - 1) // 2 res = 0 for s in range(X + 1): t = X - s if s > 18 or t < 0 or t > 18: continue term = (ways[s] * ways[t]) % mod res = (res + pow(term, m, mod)) % mod return res % mod elif H == 2 and W % 2 == 0: m = W // 2 res = 0 for s in range(X + 1): t = X - s if s > 18 or t < 0 or t > 18: continue term = (ways[s] * ways[t]) % mod res = (res + pow(term, m, mod)) % mod return res % mod else: return 0 import sys input = sys.stdin.read().split() T = int(input[0]) idx = 1 for _ in range(T): W = int(input[idx]) H = int(input[idx+1]) X = int(input[idx+2]) idx +=3 print(compute_case(W, H, X))