#include #include #include #include #include using namespace std; int gcd(int a, int b) { int c; while(b) { c = a % b; a = b; b = c; } return a; } bool cmp(int a, int b, int num_a, int num_b) { int mid = (a * num_a + b* num_b) / 2; for(int i = 0 ; i <= num_a ; i++) if((mid - i * a)%b == 0) return true; return false; } int main() { int T, a, b, c, temp; int i, j, p, q, num_a, num_b; while(~scanf("%d", &T)) { while(T--) { scanf("%d %d %d", &a, &b, &c); p = a < b ? a : b; q = a > b ? a : b; temp = gcd(a,b); if(c%temp != 0 || c%2 != 0) { cout<<"Impossible"< c) cout<<"Impossible"<