#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int MAX_N = 130;    // Change as necessary
const ll  MODD = 1000000007; //


typedef int Edge;

struct Graph {
  vector<vector<Edge> > nbr;
  int num_nodes;
  Graph(int n) : nbr(n), num_nodes(n) { }
  
  void add_edge_undirected(int u, int v) {
    nbr[u].push_back(v);
    nbr[v].push_back(u);
  }
};

int dfn, dfs[MAX_N], back[MAX_N];
bool root_art(const Graph& G,int v,int k,int child){
  if(child > 1) return true;
  for(int i=k+1;i<G.nbr[v].size();i++)
    if(!dfs[G.nbr[v][i]]) return true;
  return false;
}

vector<vector<pair<int,int> > > comps;

void do_dfs(const Graph& G, int v, int pred, stack<pair<int,int> > &e_stack){
  int child = 0;
  dfs[v] = back[v] = ++dfn;
  for (int i = 0; i < G.nbr[v].size(); i++) {
    int w = G.nbr[v][i];
    if (dfs[w] < dfs[v] && w != pred) e_stack.push(make_pair(v,w));
    if (!dfs[w]) {
      do_dfs(G, w, v, e_stack);      child++;
      
      if (back[w] >= dfs[v]) {                       // new biconnected component
        pair<int,int> e,E = make_pair(v,w);
        vector<pair<int,int> > comp;
        do{
          e = e_stack.top(); e_stack.pop();          // e belongs to this component
          comp.push_back(e);
        } while(e != E);
        comps.push_back(comp);
        if(pred != -1 || root_art(G,v,i,child)){ }   // v is articulation point
      } else back[v] = min(back[v],back[w]);
    } else back[v] = min(back[v],dfs[w]);
  }
}

void bicomp(const Graph& G) {
  stack<pair<int,int> > e_stack;
  dfn = 0; fill_n(dfs,G.num_nodes,0);
  for (int i=0;i<G.num_nodes;i++) // get rid of loop to process only one component
    if (dfs[i] == 0) do_dfs(G, i, -1, e_stack);
}

int N;

vector<int> pr;

int mu(int n){
  int ctr = 1;
  for(auto x : pr){
    if(n % x == 0){
      if(n % (x*x) == 0) return 0;
      ctr *= -1;
    }
  }
  if(ctr < 0) ctr = MODD-1;
  return ctr;
}

ll two[MAX_N];

int inv(int N){
  ll res = 1, base = N;
  int m = MODD-2;
  while(m){
    if(m % 2)
      res = res*base % MODD;
    base = base*base % MODD;
    m /= 2;
  }
  
  return res;
}

int g(int N){
  ll ans = 0;
  for(int d=1;d<=N;d++){
    if(N % d == 0){
      ans += mu(d) * two[N/d];
      ans %= MODD;
    }
  }
  ans = (ans * inv(N)) % MODD;
  return ans;
}

int f(int N){
  ll ans = 0;
  for(int i=1;i<=N;i++)
    if(N % i == 0)
      ans = (ans+g(i)) % MODD;
  return ans;
}

ll ch[3*MAX_N][3*MAX_N];

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  
  ch[0][0] = 1;
  for(int i=1;i<3*MAX_N;i++){
    ch[i][0] = ch[i][i] = 1;
    for(int j=1;j<i;j++)
      ch[i][j] = (ch[i-1][j] + ch[i-1][j-1]) % MODD;
  }
  
  pr.push_back(2);
  vector<int> is(MAX_N,true);
  for(int i=3;i<MAX_N;i+=2)
    if(is[i]){
      pr.push_back(i);
      for(int j=i*i;j<MAX_N;j+=i)
        is[j] = false;
    }
  
  int n,m,k; cin >> n >> m >> k;
  
  two[0] = 1;
  for(int i=1;i<MAX_N;i++) two[i] = (k*two[i-1]) % MODD;
  
  Graph G(n);
  
  for(int i=0;i<m;i++){
    int u,v; cin >> u >> v; u--; v--;
    G.add_edge_undirected(u,v);
  }
  
  bicomp(G);
  
  ll ans = 1;
  
  for(auto& v : comps){
    set<int> nodes;
    for(auto x : v){
      nodes.insert(x.first);
      nodes.insert(x.second);
    }
    if(nodes.size() == 1) continue;
    if(nodes.size() == v.size()){
      ans = (ans * f(nodes.size())) % MODD;
    } else if(nodes.size() == v.size()+1){
      ans = (ans * k) % MODD;
    } else {
      ans = (ans * ch[v.size()+k-1][k-1]) % MODD;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1536