//satyaki3794 #include #define ff first #define ss second #define pb push_back #define MOD (1000000007LL) #define LEFT(n) (2*(n)) #define RIGHT(n) (2*(n)+1) using namespace std; typedef long long ll; typedef pair ii; typedef pair iii; ll pwr(ll base, ll p, ll mod=MOD){ ll ans = 1;while(p){if(p&1)ans=(ans*base)%mod;base=(base*base)%mod;p/=2;}return ans; } ll gcd(ll a, ll b){ if(b == 0) return a; return gcd(b, a%b); } const int N = 100002; int n, k, x; ll DP[N][2]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin>>n>>k>>x; if(x == 1){ DP[1][0] = 1; } else{ DP[1][1] = 1; } for(int i=2;i<=n;i++){ DP[i][0] = DP[i-1][1]; DP[i][1] = (DP[i-1][0]*(k-1) + DP[i-1][1]*(k-2)) % MOD; } // cout<<"DP[0]: ";for(int i=1;i<=n;i++) cout<