#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; const int MOD = 998244353; int N, M, K; vector G[6]; map dp[6]; vector v; int g(vector &v) { int ret = 0; int tmp = 1; for (int x : v) { ret += x * tmp; tmp *= K + 1; } return ret; } int cnt = 0; int F(int now) { cnt++; if (dp[now].count(g(v))) { return dp[now][g(v)]; } bool ok = true; for (int i = 0; i < N; i++) { if (v[i] != K) { ok = false; } } if (ok) { return dp[now][g(v)] = 1; } int ret = 0; for (int nxt : G[now]) { if (v[nxt] < K) { v[nxt]++; ret += F(nxt); ret %= MOD; v[nxt]--; } } return dp[now][g(v)] = ret; }; int main() { cin >> N >> M >> K; for (int i = 0; i < M; i++) { int u, v; cin >> u >> v; u--; v--; G[u].push_back(v); G[v].push_back(u); } v = vector(N, 0); int ans = 0; for (int i = 0; i < N; i++) { v[i]++; ans += F(i); ans %= MOD; v[i]--; } cout << ans << endl; }