            for (auto &vec:m) {
                if (vec.second.size()==1) {
                    deq.push_back(vec.first);
                    cout<<"add "<<vec.first<<endl;
                }
            }


            while (n>2) {
                int dl= deq.size();
                n-=dl;
                for (int i=0;i<dl;i++) {