#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair P; typedef pair Pl; const ll MOD=1e9+7; ll gcd(ll a, ll b){ if(b==0) return a; return gcd(b, a%b); } ll powmod(ll a, ll k){ ll ap=a, ans=1; while(k){ if(k&1){ ans*=ap; ans%=MOD; } ap=ap*ap; ap%=MOD; k>>=1; } return ans; } ll inv(ll a){ return powmod(a, MOD-2); } //vector ph, pw; vector dh, dw; vector v; int main() { ll h, w, k; cin>>h>>w>>k; /*ll h1=h, w1=w; for(ll i=2; i*i<=h1; i++){ if(h1%i==0){ int e=0; while(h1%i==0){ h1/=i; } ph.push_back(i); } } if(h1>1) ph.push_back(h1);*/ for(ll i=1; i*i<=h; i++){ if(h%i==0){ dh.push_back(i); if(i*i1) pw.push_back(w1);*/ for(ll i=1; i*i<=w; i++){ if(w%i==0){ dw.push_back(i); if(i*i