/* Bismillahir Rahmanir Rahim Coder: Ahmad Faiyaz */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include # define FOR(i, a, b) for (int i=a; i #define UNIQUE(c) (c).resize( unique( all(c) ) - (c).begin() ) #define READ(f) {ifstream infile(f) ;if(infile.good()) freopen(f, "r", stdin);} #define WRITE(f) freopen(f, "w", stdout) #define CIN ios_base::sync_with_stdio(0); ///int rrr[]={1,0,-1,0};int ccc[]={0,1,0,-1}; //4 Direction ///int rrr[]={1,1,0,-1,-1,-1,0,1};int ccc[]={0,1,1,1,0,-1,-1,-1};//8 direction ///int rrr[]={2,1,-1,-2,-2,-1,1,2};int ccc[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction ///int rrr[]={2,1,-1,-2,-1,1};int ccc[]={0,1,1,0,-1,-1}; //Hexagonal Direction ///int month[]={31,28,31,30,31,30,31,31,30,31,30,31}; //month using namespace std; int main(){ #if defined( faiyaz_pc ) READ("in.txt"); #endif int t, a, b, c; CIN; cin>>t; while(t--){ cin>>a>>b>>c; bool f = 0; int mn = inf; int l = -1, r = -1; if(c % 2){ cout<<"Impossible\n"; continue; } c>>=1; for(int i=0;i<=1000;i++){ int x = i * a; int y = c - x; if(x > c) break; if(y < 0){ continue; } if(y%b){ continue; } int z = y / b; if(i + z < mn){ mn = i + z; l = i; r = z; } } if(mn == inf){ cout<<"Impossible\n"; }else{ cout<<2*l<<" "<<2*r<<"\n"; } } return 0; }