#include<stdio.h>void block(){ int i,j,k,g,n,h,ans,tot,f[32],d[32],t[32],now[32]; scanf("%d",&n); while (n) { scanf("%d",&h); h=h*12; for(i=0;i<n;i++) { scanf("%d",&f[i]); now[i]=f[i]; } for(i=0;i<n;i++) scanf("%d",&d[i]); for(i=0;i<n-1;i++) scanf("%d",&t[i]); int times[32]={0}; ans=0; for(i=0;i<n&&h>0;i++) { for(j=0;j<i;j++) now[j]=f[j]; int tnow[32]={0};tot=0; for(k=0;k<h;k++) { g=0; for(j=1;j<=i;j++) if(now[j]>now[g]) g=j; tot=tot+now[g]; now[g]=now[g]-d[g]; if(now[g]<0) now[g]=0; tnow[g]++; } if(tot>ans) { ans=tot; for(j=0;j<n;j++) times[j]=tnow[j]; } else if(tot==ans) { for(j=0;j<n;j++) if(tnow[j]!=times[j]) break; if(j<n&&tnow[j]>times[j]) for(g=j;g<n;g++) times[g]=tnow[g]; } h=h-t[i]; } for(i=0;i<n-1;i++) printf("%d, ",times[i]*5); printf("%dnNumber of fish expected: %dn",times[n-1]*5,ans); scanf("%d",&n); if(n) printf("n"); }}int main(){ int i,N; scanf("%d",&N); for(i=0;i<N;i++) { block(); if(i!=N-1) printf("n"); } return 0;}