#include using namespace std; const long long MOD = 998244353; int main(void){ int n, m; long long T; cin >> n >> m >> T; vector> A(n, vector(n, 0)); vector B(n, 0); B[0] = 1; int s, t; while(m--){ cin >> s >> t; A[s][t] = 1; A[t][s] = 1; } while(T){ if(T & 1){ vector C(n, 0); for(int i = 0; i < n; i++) for(int j = 0; j < n; j++){ C[i] = (C[i] + A[i][j] * B[j]) % MOD; } B = C; } T >>= 1; vector> C(n, vector(n, 0)); for(int i = 0; i < n; i++) for(int j = 0; j < n; j++){ for(int k = 0; k < n; k++){ C[i][j] = (C[i][j] + A[i][k] * A[k][j]) % MOD; } } A = C; } cout << B[0] << "\n"; }