#!/usr/bin/env python3 def gcd(x, y): while y != 0: r = x % y x = y y = r return x a, b, n = map(int, input().split()) g = gcd(2 * a * b, b * b - a * a) c = 2 * a * b // g d = (b * b - a * a) // g if c == 0 or d == 0: print(0) exit() tot = 0 x = a * c - b * d y = a * d + b * c x = a * c - max(x, 0) if x < n and y < n: tot += (n - x) * (n - y) * 4 x = b * c - a * d y = b * d + a * c x = b * c - min(x, 0) if x < n and y < n: tot += (n - x) * (n - y) * 4 print(tot % 998244353)