#include using namespace std; #include using namespace atcoder; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair #define LP pair #define fi first #define se second #define pb push_back #define eb emplace_back #define all(s) s.begin(), s.end() #define rall(s) s.rbegin(), s.rend() template void chmax(T& a, T b) { a = max(a, b); }; template void chmin(T& a, T b) { a = min(a, b); }; using mint = modint998244353; template struct Matrix { int h, w; vector> d; Matrix() {} Matrix(int h, int w, T val=0): h(h), w(w), d(h, vector(w,val)) {} Matrix& unit() { assert(h == w); rep(i,h) d[i][i] = 1; return *this; } const vector& operator[](int i) const { return d[i];} vector& operator[](int i) { return d[i];} Matrix operator*(const Matrix& a) const { assert(w == a.h); Matrix r(h, a.w); rep(i,h)rep(k,w)rep(j,a.w) { r[i][j] += d[i][k]*a[k][j]; } return r; } Matrix pow(ll t) const { assert(h == w); if (!t) return Matrix(h,h).unit(); if (t == 1) return *this; Matrix r = pow(t>>1); r = r*r; if (t&1) r = r*(*this); return r; } }; int main() { int n, m; ll t; cin >> n >> m >> t; Matrix d(n,n), x(n,1); x[0][0] = 1; rep(i,m) { int a, b; cin >> a >> b; d[a][b] = 1; d[b][a] = 1; } auto ans = d.pow(t)*x; cout << ans[0][0].val() << endl; return 0; }