import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //FastScanner scanner=new FastScanner(); PrintWriter out = new PrintWriter(System.out); int n=scanner.nextInt(); UnionFind uf=new UnionFind(1<<(2*n)); for(int i=0; i<(1<<(2*n)); i++) { int x=0, y=0; for(int j=0; jpar[y]) { int tmp=x; x=y; y=tmp; } par[x]+=par[y]; par[y]=x; return true; } public boolean same(int x, int y) { return find(x)==find(y); } }