def mul(a, b, mod=998244353): n = len(a) ans = [[0]*n for i in range(n)] for i in range(n): for j in range(n): for k in range(n): ans[i][j] += a[i][k] * b[k][j] ans[i][j] %= mod return ans n, m, t = map(int, input().split()) mod = 998244353 graph = [[0]*n for i in range(n)] for i in range(m): a, b = map(int, input().split()) graph[a][b] = 1 graph[b][a] = 1 ans = [[0]*n for i in range(n)] for i in range(n): ans[i][i] = 1 t_bin = bin(t)[2:] for i in range(len(t_bin))[::-1]: if t_bin[i] == "1": ans = mul(graph, ans) graph = mul(graph, graph) print(ans[0][0])