import numpy as np N, M, T = map(int, input().split()) MOD = 998244353 def pow_matrix_mod(x, n, mod=MOD): if not n: return np.eye(len(x), dtype=object) if n % 2 == 0: return pow_matrix_mod(x @ x % mod, n // 2) % mod else: return x @ pow_matrix_mod(x @ x % mod, (n - 1) // 2) % mod matr = [[0] * N for _ in range(N)] for _ in range(M): s, t = map(int, input().split()) matr[s][t] = 1 matr[t][s] = 1 matr = np.array(matr, dtype=object) print(pow_matrix_mod(matr, T)[0, 0])