#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; template using V=vector; template using VV=V>; //B(n,V(n)) ll dp[600000][6]; V G[6]; const int MOD=998244353; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n,m,k; cin>>n>>m>>k; V A(n+1); A[0]=1; rep(i,n) A[i+1]=A[i]*(k+1); rep(i,m){ int u,v; cin>>u>>v; u--,v--; G[u].push_back(v); G[v].push_back(u); } rep(i,n) dp[A[i]][i]=1; for(int i=0;i