mod = 998244353 t = int(input()) ans = 0 for i in range(t): n, m = map(int, input().split()) a = pow(10, n) - 1 b = pow(10, m) + 1 c = (a % b) % mod print(c)