#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
using namespace std;
mt19937_64 rnd;
const long long maxn = 20;
const long long mod = 1e9 + 7;
const long long base = 3e18;
const long double eps = 1e-7;
map<long long, long long> dp;
long long a[maxn];
long long n, m, k;
bool dd[maxn][maxn];
pair<long long, long long> adj[10];
bool dp1[(1ll << 6)][6];
bool chk(pair<long long, long long> a, pair<long long, long long> b) {
  if (dd[a.first][b.first] && dd[a.second][b.second]) return true;
  if (dd[a.first][b.second] && dd[a.second][b.first]) return true;
  return false;
}
void dosth(long long id) {
  if (id == n / 2 + 1) {
    long long msk = 0;
    memset(dp1, 0, sizeof(dp1));
    for (int i = 1; i <= n; i++) {
      msk = msk * 7 + a[i];
      if (!adj[a[i] - 1].first)
        adj[a[i] - 1].first = i;
      else
        adj[a[i] - 1].second = i;
    }
    long long len = n / 2;
    for (int t = 0; t < len; t++) dp1[(1ll << t)][t] = 1;
    for (int i = 1; i < (1ll << len); i++) {
      for (int j = 0; j < len; j++) {
        if (!dp1[i][j]) continue;
        for (int t = 0; t < len; t++) {
          if (i & (1ll << t)) continue;
          dp1[i + (1ll << t)][t] |= chk(adj[t], adj[j]);
        }
      }
    }
    bool kt = false;
    for (int t = 0; t < len; t++) {
      if (dp1[(1ll << len) - 1][t] && dd[adj[t].first][adj[t].second]) {
        kt = true;
        break;
      }
    }
    if (kt) {
      dp[msk] = 2;
    } else
      dp[msk] = 1;
    for (int i = 0; i < len; i++) adj[i] = make_pair(0ll, 0ll);
    return;
  }
  for (int i = 1; i <= n; i++) {
    if (!a[i]) {
      a[i] = id;
      for (int j = i + 1; j <= n; j++) {
        if (!a[j]) {
          a[j] = id;
          dosth(id + 1);
          a[j] = 0;
        }
      }
      a[i] = 0;
      return;
    }
  }
}
long long f(long long msk) {
  if (dp.count(msk)) return dp[msk];
  vector<long long> vt;
  long long nw = msk;
  vector<long long> cnt(11, 0ll);
  for (int i = 0; i < n; i++) {
    vt.push_back(msk % 7);
    cnt[msk % 7]++;
    msk /= 7;
  }
  reverse(vt.begin(), vt.end());
  long long ans = 1;
  for (int i = 0; i < vt.size(); i++) {
    if (cnt[vt[i]] >= 4) {
      for (int j = i + 1; j < vt.size(); j++) {
        if (vt[j] == vt[i]) {
          long long pre = vt[i];
          vt[i] = n / 2 + 1;
          vt[j] = n / 2 + 1;
          vector<long long> kt(8, 0ll);
          long long nxt = 0;
          long long cnt = 1;
          for (int t = 0; t < vt.size(); t++) {
            if (!kt[vt[t]]) {
              kt[vt[t]] = cnt;
              cnt++;
            }
            nxt = nxt * 7 + kt[vt[t]];
          }
          if (f(nxt) == 2) {
            ans = 2;
            break;
          }
          vt[i] = pre;
          vt[j] = pre;
        }
      }
      break;
    }
  }
  return dp[msk] = ans;
}
long long ans = 0;
void dosth1(long long id, long long cnt) {
  if (id == n + 1) {
    vector<long long> dem(13, 0ll);
    long long msk = 0;
    for (int i = 1; i <= n; i++) {
      dem[a[i]]++;
      msk = msk * 7 + a[i];
    }
    for (int i = 1; i <= n; i++) {
      if (dem[a[i]] % 2 == 1) return;
    }
    if (f(msk) == 2) {
      long long res = 1;
      for (long long t = k; t >= k - cnt + 1; t--) res = res * t;
      ans = (ans + res);
    }
    return;
  }
  for (int t = 1; t <= cnt; t++) {
    a[id] = t;
    dosth1(id + 1, cnt);
    a[id] = 0;
  }
  a[id] = cnt + 1;
  dosth1(id + 1, cnt + 1);
  a[id] = 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("t.inp", "r")) {
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
  }
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    long long x, y;
    cin >> x >> y;
    dd[x][y] = 1;
    dd[y][x] = 1;
  }
  dosth(1);
  dosth1(1, 0);
  cout << ans << "\n";
}

### Prompt

Construct a Cpp code solution to the problem outlined:

You are given a simple undirected graph with n vertices, n is even. You are going to write a letter on each vertex. Each letter should be one of the first k letters of the Latin alphabet.

A path in the graph is called Hamiltonian if it visits each vertex exactly once. A string is called palindromic if it reads the same from left to right and from right to left. A path in the graph is called palindromic if the letters on the vertices in it spell a palindromic string without changing the order.

A string of length n is good if: 

  * each letter is one of the first k lowercase Latin letters; 
  * if you write the i-th letter of the string on the i-th vertex of the graph, there will exist a palindromic Hamiltonian path in the graph. 



Note that the path doesn't necesserily go through the vertices in order 1, 2, ..., n.

Count the number of good strings.

Input

The first line contains three integers n, m and k (2 ≤ n ≤ 12; n is even; 0 ≤ m ≤ (n ⋅ (n-1))/(2); 1 ≤ k ≤ 12) — the number of vertices in the graph, the number of edges in the graph and the number of first letters of the Latin alphabet that can be used.

Each of the next m lines contains two integers v and u (1 ≤ v, u ≤ n; v ≠ u) — the edges of the graph. The graph doesn't contain multiple edges and self-loops.

Output

Print a single integer — number of good strings.

Examples

Input


4 3 3
1 2
2 3
3 4


Output


9


Input


4 6 3
1 2
1 3
1 4
2 3
2 4
3 4


Output


21


Input


12 19 12
1 3
2 6
3 6
3 7
4 8
8 5
8 7
9 4
5 9
10 1
10 4
10 6
9 10
11 1
5 11
7 11
12 2
12 5
12 11


Output


456165084

### Response

```cpp
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
using namespace std;
mt19937_64 rnd;
const long long maxn = 20;
const long long mod = 1e9 + 7;
const long long base = 3e18;
const long double eps = 1e-7;
map<long long, long long> dp;
long long a[maxn];
long long n, m, k;
bool dd[maxn][maxn];
pair<long long, long long> adj[10];
bool dp1[(1ll << 6)][6];
bool chk(pair<long long, long long> a, pair<long long, long long> b) {
  if (dd[a.first][b.first] && dd[a.second][b.second]) return true;
  if (dd[a.first][b.second] && dd[a.second][b.first]) return true;
  return false;
}
void dosth(long long id) {
  if (id == n / 2 + 1) {
    long long msk = 0;
    memset(dp1, 0, sizeof(dp1));
    for (int i = 1; i <= n; i++) {
      msk = msk * 7 + a[i];
      if (!adj[a[i] - 1].first)
        adj[a[i] - 1].first = i;
      else
        adj[a[i] - 1].second = i;
    }
    long long len = n / 2;
    for (int t = 0; t < len; t++) dp1[(1ll << t)][t] = 1;
    for (int i = 1; i < (1ll << len); i++) {
      for (int j = 0; j < len; j++) {
        if (!dp1[i][j]) continue;
        for (int t = 0; t < len; t++) {
          if (i & (1ll << t)) continue;
          dp1[i + (1ll << t)][t] |= chk(adj[t], adj[j]);
        }
      }
    }
    bool kt = false;
    for (int t = 0; t < len; t++) {
      if (dp1[(1ll << len) - 1][t] && dd[adj[t].first][adj[t].second]) {
        kt = true;
        break;
      }
    }
    if (kt) {
      dp[msk] = 2;
    } else
      dp[msk] = 1;
    for (int i = 0; i < len; i++) adj[i] = make_pair(0ll, 0ll);
    return;
  }
  for (int i = 1; i <= n; i++) {
    if (!a[i]) {
      a[i] = id;
      for (int j = i + 1; j <= n; j++) {
        if (!a[j]) {
          a[j] = id;
          dosth(id + 1);
          a[j] = 0;
        }
      }
      a[i] = 0;
      return;
    }
  }
}
long long f(long long msk) {
  if (dp.count(msk)) return dp[msk];
  vector<long long> vt;
  long long nw = msk;
  vector<long long> cnt(11, 0ll);
  for (int i = 0; i < n; i++) {
    vt.push_back(msk % 7);
    cnt[msk % 7]++;
    msk /= 7;
  }
  reverse(vt.begin(), vt.end());
  long long ans = 1;
  for (int i = 0; i < vt.size(); i++) {
    if (cnt[vt[i]] >= 4) {
      for (int j = i + 1; j < vt.size(); j++) {
        if (vt[j] == vt[i]) {
          long long pre = vt[i];
          vt[i] = n / 2 + 1;
          vt[j] = n / 2 + 1;
          vector<long long> kt(8, 0ll);
          long long nxt = 0;
          long long cnt = 1;
          for (int t = 0; t < vt.size(); t++) {
            if (!kt[vt[t]]) {
              kt[vt[t]] = cnt;
              cnt++;
            }
            nxt = nxt * 7 + kt[vt[t]];
          }
          if (f(nxt) == 2) {
            ans = 2;
            break;
          }
          vt[i] = pre;
          vt[j] = pre;
        }
      }
      break;
    }
  }
  return dp[msk] = ans;
}
long long ans = 0;
void dosth1(long long id, long long cnt) {
  if (id == n + 1) {
    vector<long long> dem(13, 0ll);
    long long msk = 0;
    for (int i = 1; i <= n; i++) {
      dem[a[i]]++;
      msk = msk * 7 + a[i];
    }
    for (int i = 1; i <= n; i++) {
      if (dem[a[i]] % 2 == 1) return;
    }
    if (f(msk) == 2) {
      long long res = 1;
      for (long long t = k; t >= k - cnt + 1; t--) res = res * t;
      ans = (ans + res);
    }
    return;
  }
  for (int t = 1; t <= cnt; t++) {
    a[id] = t;
    dosth1(id + 1, cnt);
    a[id] = 0;
  }
  a[id] = cnt + 1;
  dosth1(id + 1, cnt + 1);
  a[id] = 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("t.inp", "r")) {
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
  }
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    long long x, y;
    cin >> x >> y;
    dd[x][y] = 1;
    dd[y][x] = 1;
  }
  dosth(1);
  dosth1(1, 0);
  cout << ans << "\n";
}

```