import numpy as np def matqpow2(base: "np.ndarray", exp: int, mod: int) -> "np.ndarray": """np矩阵快速幂""" res = np.eye(*base.shape, dtype=np.uint64) while exp: if exp & 1: res = (res @ base) % mod base = (base @ base) % mod exp >>= 1 return res n, m, k = map(int, input().split()) adjMatrix = [[0] * n for _ in range(n)] for _ in range(m): u, v = map(int, input().split()) u, v = u - 1, v - 1 adjMatrix[u][v] = adjMatrix[v][u] = 1 adjMatrix = np.array(adjMatrix, dtype=np.uint64) T = matqpow2(adjMatrix, k, 998244353) print(T[0][0])