#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; ll dp[1010][1010]; ll MOD = 998244353; struct Edge { int u; int v; Edge(int u = -1, int v = -1) { this->u = u; this->v = v; } }; int main() { int N, M, T; cin >> N >> M >> T; vector E; for (int i = 0; i < M; ++i) { int s, t; cin >> s >> t; E.push_back(Edge(s, t)); } memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int i = 0; i < T; ++i) { for (int j = 0; j < M; ++j) { Edge &e = E[j]; dp[i + 1][e.u] += dp[i][e.v]; dp[i + 1][e.v] += dp[i][e.u]; dp[i + 1][e.u] %= MOD; dp[i + 1][e.v] %= MOD; } } cout << dp[T][0] << endl; return 0; }