#include<iostream>
#define ull unsigned long long
using namespace std;
ull pow(ull a,ull b,ull mod)
{
if(b==0) return 1;
if(b%2==1) return pow(a,b-1,mod)*a%mod;
ull flag=pow(a,b/2,mod);
return flag*flag%mod;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
ull a,b,k; scanf("%llu%llu%llu",&a,&b,&k);
if(a>b)
{
if(k%a==0&&k%b!=0) printf("2");
else printf("1");
}
else cout<<pow(2,(k-k%a)/a-(k-k%b)/b,998244353);
return 0;
}