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:
#include <bits/stdc++.h>
using namespace std;

using ll=int64_t;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define REACH cerr<<"reached line "<<__LINE__<<endl
#define DMP(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define ZERO(x) memset(x,0,sizeof(x))

using pi=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

int read(){
	int i;
	scanf("%" SCNd64,&i);
	return i;
}

void printSpace(){
	printf(" ");
}

void printEoln(){
	printf("\n");
}

void print(int x,int suc=1){
	printf("%" PRId64,x);
	if(suc==1)
		printEoln();
	if(suc==2)
		printSpace();
}

string readString(){
	static char buf[3341000];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341000];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

template<class T,class U>
void chmin(T& a,U b){
	if(a>b)
		a=b;
}

template<class T>
T Sq(const T& t){
	return t*t;
}

const int inf=LLONG_MAX/3;

const int mod=1000000007;
template<class T,class U>
void add(T& a,U b){
	a=((ll)a+b)%mod;
}

template<class T,class U>
void sub(T& a,U b){
	a=((ll)a-b%mod+mod)%mod;
}

template<class T,class U>
void mult(T& a,U b){
	a=((ll)a*b)%mod;
}

ll modPow(ll a,ll p){
	ll s=1;
	while(p){
		if(p&1)mult(s,a);
		mult(a,a);
		p>>=1;
	}
	return s;
}

ll modInv(ll a){
	return modPow(a,mod-2);
}

const int Vmax=1000010;
int fact[Vmax],factInv[Vmax];
void InitFact(){
	fact[0]=1;
	FOR(i,1,Vmax){
		fact[i]=fact[i-1];
		mult(fact[i],i);
	}
	factInv[Vmax-1]=modInv(fact[Vmax-1]);
	for(int i=Vmax-2;i>=0;i--){
		factInv[i]=factInv[i+1];
		mult(factInv[i],i+1);
	}
}
int Choose(int n,int k){
	return fact[n]*factInv[n-k]%mod*factInv[k]%mod;
}

void gen(int len,int i,int a,vi&s,vector<vi>&dst){
	if(len==i)
		return void(dst.PB(s));
	REP(j,a){
		s.PB(j);
		gen(len,i+1,a,s,dst);
		s.pop_back();
	}
}
const int Nmax=210;
int n,m,a,ans,dp[Nmax],dq[Nmax],powBuf[Nmax];
void Init(){
	powBuf[0]=1;
	FOR(i,1,Nmax){
		powBuf[i]=powBuf[i-1];
		mult(powBuf[i],a);
	}
}
bool Check(const vi&s,const vi&t){
	int p=s.size(),q=t.size();
	REP(i,p-q+1){
		bool ok=true;
		REP(j,q)ok&=(s[i+j]==t[j]);
		if(ok)return true;
	}
	return false;
}
int GuChokudai(){
	vector<vi> ss,ts;
	vi tmp;
	gen(n,0,a,tmp,ss);
	gen(m,0,a,tmp,ts);
	int cnt=0;
	for(const auto&s:ss)for(const auto&t:ts)
		if(Check(s,t))cnt++;
	return cnt;
}
int Wafrelka(int d){
	ZERO(dp);
	ZERO(dq);
	FOR(i,m,n+1){
		dp[i]=modPow(a,i-m);
		REP(j,m)if((d>>j)&1LL)
			sub(dp[i],dp[i-m+j]);
		sub(dp[i],dq[i-m]);
		dq[i]=dp[i];
		add(dq[i],dq[i-1]*a);
	}
	return dq[n];
}
pi Futago(int d){
	assert(a==2);
	int cnt=0;
	REP(bit,1LL<<m){
		bool ok=true;
		FOR(i,1,m){
			int b=bit>>(m-i);
			bool same=(b==(bit&((1LL<<i)-1)));
			if(same!=((d>>i)&1))ok=false;
		}
		if(ok)
			cnt++;
	}
	return pi(cnt,Wafrelka(d));
}
void Tozan(int d){
	assert(a==2);
	REP(bit,1LL<<m){
		bool ok=true,ok2=false;
		FOR(i,1,m){
			int b=bit>>(m-i);
			bool same=(b==(bit&((1LL<<i)-1)));
			if(((d>>i)&1)&&!same)ok=false;
			if(((d>>i)&1)!=same)ok2=true;
		}
		if(ok&&ok2){
			vi arr(m);
			REP(i,m)arr[i]=(bit>>i)&1LL;
			cout<<arr<<endl;
		}
	}
}
vi divs,ways;
void rec(int len,int d,int w){
	if(len==m){
		int wtmp=w;
		REP(i,divs.size())
			if((d&divs[i])==d)
				sub(w,ways[i]);
		divs.PB(d);
		ways.PB(w);
		//pi ft=Futago(d);
		int wf=Wafrelka(d);
		/*if(ft!=pi(w,wf)){
			cerr<<d<<endl;
			cerr<<ft<<endl;
			cerr<<wtmp<<endl;
			cerr<<pi(w,wf)<<endl;
			cerr<<divs<<endl;
			cerr<<ways<<endl;
			//Tozan(d);
			assert(false);
		}*/
		add(ans,wf*w);
		//ans++;
		return;
	}
	FOR(e,len+1,m+1){
		int f=d|(1LL<<e);
		int g=w;
		if(e>=len*2){
			mult(g,powBuf[e-len*2]);
			rec(e,f,g);
		}else if((d>>(len*2-e))&1){
			rec(e,f,g);
		}
	}
	/*FOR(i,1,len){
		int e=len,f=d;
		while(e-1>=i){
			f|=(1LL<<e);
			e-=i;
		}
		int g=w;
		mult(g,modPow(a,i-e));
		rec(e,f,g);
	}
	{
		int e=0,f=d|(1LL<<len);
		int g=w;
		mult(g,modPow(a,len));
		rec(e,f,g);
	}*/
}

signed main(){
	n=read(),m=read(),a=read();
	Init();
	rec(0,0,1);
	cout<<ans<<endl;
	//cout<<GuChokudai()<<endl;
	/*{
		assert(m==1);
		int w=modPow(a,n);
		sub(w,modPow(a-1,n));
		mult(w,a);
		cout<<w<<endl;
	}*/
	/*{
		assert(n==m);
		cout<<modPow(a,n)<<endl;
	}*/
}