Problem: Sunuke came up with a pun called "s de t t", but forgot it. Sunuke remembers the following.

* The length of s is N.
* The length of t is M.
* t is a substring of s. (There is a part of consecutive M characters of s that matches t.)



Divide the number of possible combinations as (s, t) by 1,000,000,007 to find the remainder. However, it is assumed that there are A types of characters.

Constraints

* 1 ≤ N ≤ 200
* 1 ≤ M ≤ 50
* M ≤ N
* 1 ≤ A ≤ 1000

Input


N M A


Output

Divide the number of character string pairs (s, t) that satisfy the condition by 1,000,000,007 and output the remainder.

Examples

Input

3 2 2


Output

14


Input

200 50 1000


Output

678200960

Solution (in CPP):

Solution:
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
typedef pair<int, ll> i_ll;
struct edge { int u, v; ll w; };

ll INF = LLONG_MAX / 2;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

struct union_find {
	vector<int> v;
	union_find(int n) : v(n, -1) {}
	int find(int x) { return v[x] < 0 ? x : v[x] = find(v[x]); }
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y) return;
		if (x > y) swap(x, y);
		v[x] += v[y]; v[y] = x;
	}
	bool root(int x) { return v[x] < 0; }
	bool same(int x, int y) { return find(x) == find(y); }
	int size(int x) { return -v[find(x)]; }
};

ll pow_mod(ll x, ll n, int M) {
	ll ans = 1;
	for (; n; n>>=1) {
		if (n & 1) ans = ans * x % M;
		x = x * x % M;
	}
	return ans;
}

map<vector<int>, int> mp[200];

int main() {
	int N, M, A; cin >> N >> M >> A;
	union_find a(M);
	int ans = 0;
	for (int i = 0; i + M <= N; i++) {
		mp[i][a.v] = (mp[i][a.v] + pow_mod(A, i, MOD)) % MOD;
		for (auto p: mp[i]) {
			vector<int> a = p.first;
			int x = p.second, z = x;
			for (int j = 0; j < M; j++)
				if (a[j] < 0)
					z = (ll)z * A % MOD;
			ans = (ans + z * pow_mod(A, N - (i + M), MOD)) % MOD;
			for (int d = 1; i + d + M <= N; d++)
				if (d <= M - 1) {
					union_find uf(M); uf.v = a;
					for (int j = 0; j + d < M; j++)
						uf.unite(j, j + d);
					for (int j = 0; j < M; j++)
						uf.find(j);
					int& _x = mp[i + d][uf.v];
					_x = (_x - x) % MOD;
				}
				else {
					int& _x = mp[i + d][a];
					_x = (_x - x * pow_mod(A, d - M, MOD)) % MOD;
				}
		}
	}
	cout << (ans + MOD) % MOD << endl;
}