import java.io.PrintWriter; import java.nio.file.spi.FileSystemProvider; import java.util.*; import java.util.prefs.BackingStoreException; import javax.swing.text.Highlighter.Highlight; class MaximumFlow { public ArrayList[] G; private boolean[] used; public class Edge{ int to; int cap; int rev; public Edge(int to,int cap, int rev){ this.to = to; this.cap = cap; this.rev = rev; } } public MaximumFlow(int v){ used = new boolean[v]; G = new ArrayList[v]; for(int i=0;i(); } } public void addEdge(int from,int to, int cap){ G[from].add(new Edge(to, cap, G[to].size())); G[to].add(new Edge(from, 0, G[from].size()-1)); } private int dfs(int v, int t, int f){ if(v==t) return f; used[v]=true; for(int i=0;i0){ int d = dfs(edge.to,t,Math.min(f,edge.cap)); if(d>0){ edge.cap-=d; G[edge.to].get(edge.rev).cap += d; return d; } } } return 0; } public int maxFlow(int s,int t){ int flow = 0; for(;;){ Arrays.fill(used, false); int f = dfs(s, t, Integer.MAX_VALUE); if(f==0) return flow; flow+=f; } } } public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] ng = new int[n]; for(int i=0;i