#include #if __has_include() #include using namespace atcoder; #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::vector; using ll = long long; using mint = modint998244353; vector> matmul(vector>& A, vector>& B) { int n = A.size(); vector C(n, vector(n)); rep(i, n)rep(j, n)rep(k, n) C[i][k] += A[i][j] * B[j][k]; return C; } vector> matexp(vector>& A, ll b) { int n = A.size(); vector Z(n, vector(n)); rep(i, n) Z[i][i] = 1; while (b > 0) { if (b & 1) Z = matmul(Z, A); A = matmul(A, A); b /= 2; } return Z; } int main() { int n, m; ll t; cin >> n >> m >> t; vector A(n, vector(n)); rep(i, m) { int s, t; cin >> s >> t; A[s][t] = A[t][s] = 1; } A = matexp(A, t); cout << A[0][0].val() << '\n'; return 0; }