using namespace std; int main() { int t;cin>>t; while(t--){ int a,b,n;cin>>a>>b>>n; int min=a<b?a:b; if(n<min) cout<<"Impossible\n"; else{ if(a>b){ int x,y,j=-1,k=-1; for(x=n/a;x>=0;x--){ if((n-x*a)%b==0){ y=(n-x*a)/b; j=x;k=y; break; } } if(j==-1&&k==-1) cout<<"Impossible"<<endl; else cout<<j<<" "<<k<<endl; } else{ int x,y,j=-1,k=-1; for(x=n/b;x>=0;x--){ if((n-x*b)%a==0){ y=(n-x*b)/a; j=x;k=y; break; } } if(j==-1&&k==-1) cout<<"Impossible"<<endl; else cout<<k<<" "<<j<<endl; } } } }
include