int[]j;for(int k;;write(k)){eval("j=new int[]{"+stdin+"};",true);if(j.length<1)break;k=1;for(;j.length>0;)k*=j.pop();}