MOD = 998244353 def main(): import sys input = sys.stdin.read().split() idx = 0 N = int(input[idx]); idx +=1 M = int(input[idx]); idx +=1 T = int(input[idx]); idx +=1 # Initialize adjacency matrix A = [[0]*N for _ in range(N)] for _ in range(M): s = int(input[idx]); idx +=1 t = int(input[idx]); idx +=1 A[s][t] += 1 A[t][s] += 1 # Matrix multiplication function def multiply(a, b): res = [[0]*N for _ in range(N)] for i in range(N): for k in range(N): if a[i][k] == 0: continue for j in range(N): res[i][j] = (res[i][j] + a[i][k] * b[k][j]) % MOD return res # Matrix exponentiation (binary method) def matrix_pow(mat, power): # Initialize result as identity matrix result = [[0]*N for _ in range(N)] for i in range(N): result[i][i] = 1 current = [row[:] for row in mat] while power > 0: if power % 2 == 1: result = multiply(result, current) current = multiply(current, current) power //= 2 return result # Compute A^T if T == 0: print(1 % MOD) return A_power = matrix_pow(A, T) print(A_power[0][0] % MOD) if __name__ == "__main__": main()