Function to add edges
static void addedge ( int a , int b ) { if ( tree . get ( a ) == null ) tree . put ( a , new ArrayList < > ( ) ) ; tree . get ( a ) . add ( b ) ; if ( tree . get ( b ) == null ) tree . put ( b , new ArrayList < > ( ) ) ; tree . get ( b ) . add ( a ) ; } static void FindCenter ( int n ) {