#include using namespace std; int power(int a){ if(a==0) return 1; int temp=1; for(int i=1;i> a >> b >> k >> c; if(a==b){ if(c==a || c==b) vysledok=k; } else{ if(c==a || c==b) vysledok=power(k)*k; } cout << vysledok%1000000007 << endl; return 0; }