import numpy as np #A**n def mat_pow(A, n, mod): size = len(A) res = np.eye(size, dtype=np.object) while n > 0: if n & 1 == 1: res = res @ A res %= mod A = A @ A A %= mod n = n>>1 return res import sys import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline mod = 998244353 def main(): n, m, t = map(int, input().split()) A = [[0]*n for i in range(n)] for i in range(m): u, v = map(int, input().split()) A[u][v] = 1 A[v][u] = 1 A = np.array(A) A = mat_pow(A, t, mod) ans = A[0][0]%mod print(ans) if __name__ == '__main__': main()