#include using namespace std; const int nmax=1e6+42; int m,l,a1,a2,b1,b2; int most; int when_1,when_2; int before[5]; void solve() { scanf("%i%i%i%i%i%i",&m,&l,&a1,&a2,&b1,&b2); most=0; when_1=-1; when_2=-1; before[0]=m; before[1]=12; before[2]=12; before[3]=12; for(int years=4;years>=0;years--) { for(int sell_1=-1;sell_1<=years;sell_1++) for(int sell_2=-1;sell_2<=years;sell_2++) { when_1=(sell_1==-1?-1:sell_1*12+m); when_2=(sell_2==-1?-1:sell_2*12+m); long long money=0; bool ok=1; for(int cur=0;cur