#include <bits/stdc++.h>

#define reg register
#define pr std::pair<int, int>
#define fi first
#define se second
#define FIN(s) freopen(s, "r", stdin)
#define FOUT(s) freopen(s, "w", stdout)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, l, r) for (int i = l; i <= r; ++i)
#define lep(i, l, r) for (int i = l; i < r; ++i)
#define irep(i, r, l) for (int i = r; i >= l; --i)
#define ilep(i, r, l) for (int i = r; i > l; --i)
#define Rep(i, n) rep(i, 1, n)
#define Lep(i, n) lep(i, 1, n)
#define IRep(i, n) irep(i, n, 1)
#define ILep(i, n) ilep(i, n, 1)
typedef long long ll;
typedef long double ld;

namespace modular {
    const int MOD = 1000000007;
    inline int add(int x, int y) { return (x += y) >= MOD ? x -= MOD : x; }
    inline void inc(int &x, int y) { (x += y) >= MOD ? x -= MOD : 0; }
    inline int mul(int x, int y) { return 1LL * x * y % MOD; }
    inline int qpow(int x, int y) {
        int ans = 1;
        for (; y; y >>= 1, x = mul(x, x))
            if (y & 1)
                ans = mul(ans, x);
        return ans;
    }
}; // namespace modular
using namespace modular;

namespace Base {
    template <typename Tp> inline Tp input() {
        Tp x = 0, y = 1;
        char c = getchar();
        while ((c < '0' || '9' < c) && c != EOF) {
            if (c == '-')
                y = -1;
            c = getchar();
        }
        if (c == EOF)
            return 0;
        while ('0' <= c && c <= '9')
            x = x * 10 + c - '0', c = getchar();
        return x *= y;
    }
    template <typename Tp> inline void read(Tp &x) { x = input<Tp>(); }
    template <typename Tp> inline void chmax(Tp &x, Tp y) { x < y ? x = y : 0; }
    template <typename Tp> inline void chmin(Tp &x, Tp y) { x > y ? x = y : 0; }
}; // namespace Base
using namespace Base;
/*----------------------------------------------------------------------------*/

#define MAX_N 207

int N, M, K;
int tot, top, dn;
int head[MAX_N], to[MAX_N << 1], nxt[MAX_N << 1], cap;
int bl[MAX_N], dfn[MAX_N], low[MAX_N];
int sze[MAX_N], szv[MAX_N];
int C[MAX_N][MAX_N];
pr st[MAX_N];

inline void addE(int u, int v) {
    nxt[++cap] = head[u];
    head[u] = cap;
    to[cap] = v;
}

void dfs(int u, int las) {
    dfn[u] = low[u] = ++dn;
    for (int i = head[u]; i; i = nxt[i])
        if (to[i] != las) {
            int v = to[i];
            if (!dfn[v]) {
                st[++top] = pr(u, v);
                dfs(v, u);
                chmin(low[u], low[v]);
                if (dfn[u] <= low[v]) {
                    ++tot;
                    while (top) {
                        int x = st[top].fi, y = st[top].se;
                        top--;
                        ++sze[tot];
                        if (bl[x] != tot)
                            bl[x] = tot, ++szv[tot];
                        if (bl[y] != tot)
                            bl[y] = tot, ++szv[tot];
                        if (x == u && y == v)
                            break;
                    }
                }
            } else if (dfn[v] < dfn[u])
                st[++top] = pr(u, v), chmin(low[u], dfn[v]);
        }
}

void solve() {
    C[0][0] = 1;
    Rep(i, M + K) {
        C[i][0] = 1;
        Rep(j, i) C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
    }
    int res = 1;
    Rep(i, tot) {
        if (sze[i] == 1) {
            res = mul(res, K);
        } else if (szv[i] == sze[i]) {
            int tmp = 0, L = szv[i];
            Rep(j, L) inc(tmp, qpow(K, std::__gcd(j, L)));
            tmp = mul(tmp, qpow(L, MOD - 2));
            res = mul(res, tmp);
        } else {
            res = mul(res, C[K + sze[i] - 1][K - 1]);
        }
    }
    printf("%d\n", res);
}

int main() {
#ifdef LOCAL
    FIN("in");
#endif
    read(N), read(M), read(K);
    int u, v;
    Rep(i, M) {
        read(u), read(v);
        addE(u, v);
        addE(v, u);
    }
    Rep(i, N) if (!dfn[i]) dfs(i, 0);
    solve();
    return 0;
}


Measured memory_bytes: 384