/*
杨辉三角
*/
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int d[1010][1010];
int f(long long a,long long b,long long k)
{
long long t=1,y=a;
while (b!=0)
{
if (b&1==1) t=t*y%k;
y=y*y%k;
b=b>>1;
}
return t;
}
int main()
{
int a,b,k,n,m;
cin>>a>>b>>k>>n>>m;
for (int i=1;i<=k+1;i++)
{
d[i][1]=1; d[i][i]=1;
}
for (int i=3;i<=k+1;i++)
for (int j=2;j<=i;j++)
d[i][j]=(d[i-1][j-1]+d[i-1][j])%10007;
cout<<((d[k+1][k-n+1]*f(a,n,10007))%10007*f(b,m,10007))%10007;//小心爆掉小心爆掉小心爆掉
return 0;
}