def Matprod(A, B, mod): N = len(A) temp = [0] * (N * N) for i in range(N): for k in range(N): for j in range(N): temp[i*N+j] += A[i*N+k] * B[k*N+j] temp[i*N+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*N+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 * N) for i in range(M): s, t = map(int, input().split()) G[s*N+t] = 1 G[t*N+s] = 1 G = Matpow(G, T, mod) print(G[0])