q=parse;r=reduce;v,b=0,join(reverse(digits(q(BigInt,"1"*readline(),base=16),base=2))[2:end]);function p(i);t(c)=q(Int,b[i[1]:((i[1]+=c)-1)],base=2);global v+=t(3);d,c=t(3),1;d==4&&return r((a,b)->16a+b,[t(4) for _=1:99 if c==1&&(c=t(1))<2]);a(v)=r([+,*,min,max,i,>,<,==][d+1],v);(t(1)==0&&(g=t(15)+i[1])!=0) ? (return[p(i) for _=1:99 if i[1]<g]|>a) : return[p(i) for _=1:t(11)]|>a;end;p([1])|>b->println("$v\n$b")
