def Matprod(A, B, mod): N = len(A) temp = [[0] * N for i in range(N)] for i in range(N): for j in range(N): for k in range(N): temp[i][j] += A[i][k] * B[k][j] temp[i][j] %= mod return temp def Matpow(A, M, mod): N = len(A) Mat = [[0] * N for i in range(N)] for i in range(N): Mat[i][i] = 1 for i in range(64): if (M >> i) & 1: Mat = Matprod(Mat, A, mod) A = Matprod(A, A, mod) return Mat N, M, T = map(int, input().split()) mod = 998244353 G = [[0] * N for i in range(N)] for i in range(M): s, t = map(int, input().split()) G[s][t] = 1 G[t][s] = 1 G = Matpow(G, T, mod) print(G[0][0])