from collections import defaultdict import numpy as np N, M, T = map(int, input().split()) A = np.zeros(shape=(N, N), dtype=np.int64) for _ in range(M): s, t = map(int, input().split()) A[s, t] = 1 A[t, s] = 1 mod = 998244353 def mat_mul(A, B, MOD): A1, A2 = A >> 15, A & (1 << 15) - 1 B1, B2 = B >> 15, B & (1 << 15) - 1 AB1 = np.dot(A1, B1) % MOD AB2 = np.dot(A2, B2) AB3 = np.dot(A1+A2, B1+B2) - AB1 - AB2 return ((AB1 << 30) + (AB3 << 15) + AB2) % MOD def mat_pow(A, K): P = np.eye(len(A), dtype=np.int64) while K: if K & 1: P = mat_mul(A, P, mod) A = mat_mul(A, A, mod) K >>= 1 return P P = mat_pow(A, T) print(P[0, 0])