$n=<>;printf+(grep{@0=map 1<<$_,0,0..$_-1;push@0,$0[-1]*2-shift@0while$0[0]<$n;$0[0]==$n}2..61),-1