For finding bridges
static int timer = 0 ; static int diameter ; static class pair { int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static void swap ( int x , int y ) { int temp = x ; x = y ; y = temp ; } static int find_set ( int a ) {