MOD = 998244353 T = int(input()) for i in range(T): [N, M] = input().split() N = int(N) M = int(M) m = 10**N - 1 n = 10**M + 1 ans = (m % n) % MOD print(ans)