("$System.in"=~/.+/)*.toLong().sort{n->b=n&-n;n-b?n+1e8*b:9e9-n}.any''.&println