mod = 998244353 def mat_mul(a, b): n_a, m_a = len(a), len(a[0]) n_b, m_b = len(b), len(b[0]) res = [[0] * m_b for i in range(n_a)] for i in range(n_a): for k in range(m_a): for j in range(m_b): res[i][j] += a[i][k] * b[k][j] res[i][j] %= mod return res def mat_pow(a, k): if k == 1: return a n = len(a) res = [[0] * n for i in range(n)] for i in range(n): res[i][i] = 1 while k: if k & 1: res = mat_mul(res, a) a = mat_mul(a, a) k >>= 1 return res n, m, t = map(int, input().split()) G = [[0] * n for i in range(n)] for _ in range(m): a, b = map(int, input().split()) G[a][b] = 1 G[b][a] = 1 G = mat_pow(G, t) b = [[0] * n for i in range(n)] b[0][0] = 1 G = mat_mul(G, b) print(G[0][0])