#include #include #include #include #include #include #include #define inf 9999999 #define mo 1000000007 #define LL long long using namespace std; const int maxn=10000; int x[maxn],y[maxn],n[maxn]; int main() { int t,a,b,c,ans; cin>>t; while(t--) { cin>>a>>b>>c; if (c%2!=0) {cout<<"Impossible"<n[i]+1) { n[i+a]=n[i]+1; x[i+a]=x[i]+1; y[i+a]=y[i]; } if (!n[i+b]) { n[i+b]=n[i]+1; x[i+b]=x[i]; y[i+b]=y[i]+1; } else if (n[i+b]>n[i]+1) { n[i+b]=n[i]+1; x[i+b]=x[i]; y[i+b]=y[i]+1; } } } if (n[c]==0) {cout<<"Impossible"<