<>;map{($l,$r)=map{//*grep$'>>$_,0..30}glob;print$r-$l?2**--$r*(2**$r-1):!$r-1,$/}<>