import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { static FastScanner scan = new FastScanner(); static PrintWriter pw = new PrintWriter(System.out); static UnionFind union; static int N, Q; public static void main(String[] args) { N = scan.nextInt(); Q = scan.nextInt(); union = new UnionFind(N); for(int i=0; i Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next()); } }