#include using namespace std; using ll = long long; const ll MOD = 998244353; using P = pair; #define rep(i, n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() template vector> MatrixProduct(vector> vec1, vector> vec2){ int N = vec1.size(), M = vec2[0].size(), L = vec2.size(); vector> res(N,vector(M,0)); rep(i,N) rep(j,M) rep(k,L){ res[i][j] += vec1[i][k] * vec2[k][j]; res[i][j] %= MOD; } return res; } int main(){ ll n,m,t; cin >> n >> m >> t; vector> mult(n,vector(n,0)); rep(i,m){ int a,b; cin >> a >> b; mult[a][b] = mult[b][a] = 1; } vector> a(1,vector(n,0)); a[0][0] = 1; while(t){ if(t&1){ a = MatrixProduct(mult,a); } mult = MatrixProduct(mult,mult); t >>= 1; } cout << a[0][0] << endl; return 0; }