import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { new Main().run(); } final long MOD=(long)1e9+7; long ADD(long...a) { long ret=0; for(long v:a)ret=(ret+v)%MOD; return ret; } int pointer=0; void dfs(int cur,int par,ArrayList[] g,int[] l,int[] r,int[] v) { l[cur]=pointer; v[pointer++]=cur; for(int dst:g[cur]) { if(dst==par)continue; dfs(dst,cur,g,l,r,v); } r[cur]=pointer; v[pointer++]=cur; } void run() { Scanner sc=new Scanner(System.in); int N=sc.nextInt(); int[] l=new int[N]; int[] r=new int[N]; int[] v=new int[2*N]; Arrays.fill(l, -1); Arrays.fill(r, -1); Arrays.fill(v, -1); int K=sc.nextInt(); ArrayList[] g=new ArrayList[N]; for(int i=0;i(); for(int i=0;i