BaoBao has a sequence a1,a2,...,an. He would like to find a subset S of {1,2,...,n} such that ∀i,j∈S, ai ⊕aj<min(ai ,aj) and ∣S∣ is maximum, where ⊕ means bitwise exclusive or. Input There are multiple test cases. The first line of input contai…