import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); long t = sc.nextLong(); long[][] a = new long[n][n]; for (int i = 0; i < m; i++) { int u = sc.nextInt(); int v = sc.nextInt(); a[u][v] = 1; a[v][u] = 1; } sc.close(); int mod = 998244353; long[][] b = matrixPow(a, t, mod); long[] c = new long[n]; c[0] = 1; long[] d = matrixMul1(c, b, mod); System.out.println(d[0]); } static long[][] matrixPow(long[][] a, long k, int m) { if (k == 1) { return a; } long[][] ret = matrixPow(a, k / 2, m); ret = matrixMul(ret, ret, m); if (k % 2 == 1) { ret = matrixMul(ret, a, m); } return ret; } static long[][] matrixMul(long[][] a, long[][] b, int m) { int h = a.length; int w = b[0].length; int n = a[0].length; long[][] c = new long[h][w]; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { for (int x = 0; x < n; x++) { c[i][j] += a[i][x] * b[x][j]; c[i][j] %= m; } } } return c; } static long[] matrixMul1(long[] a, long[][] b, int m) { int w = b[0].length; int n = a.length; long[] c = new long[w]; for (int j = 0; j < w; j++) { for (int x = 0; x < n; x++) { c[j] += a[x] * b[x][j]; c[j] %= m; } } return c; } }