struct Virual_Tree
{
    vector<int> Tree[N];
    int _top,s[250010];

    void ins(int x)
    {
        if(_top == 1) { s[++_top] = x; return;}
        int lca = LCA.lca(x,s[_top]);
        while(_top > 1 && id[s[_top-1]] >= id[lca]) Tree[s[_top-1]].pb(s[_top]),_top--;
        if(lca != s[_top]) Tree[lca].pb(s[_top]),s[_top] = lca;
        s[++_top] = x;
    }
    void build(vector<int> a) // 将需要的点求如a中
    {
        s[_top = 1] = 1;
        sort(all(a),cmp);
        // 这里cmp是点的dfs序
        for(auto x:a) ins(x);
        while(_top > 0)  Tree[s[_top - 1]].pb(s[_top]),_top--;
    }
}VT;