import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } void remove(boolean[][] g, int[] out_deg, boolean[] removed, int v) { assert(!removed[v]); int n=g.length; for (int i=0;i ans=new ArrayList<>(); PrintWriter pw=new PrintWriter(System.out); while (true) { ArrayList list=new ArrayList<>(); do { for (int i=0;i") && !g[a][b]) { g[a][b]=true; if (!removed[a] && !removed[b]) ++out_deg[a]; } else if(a!=-1 && b!=-1 && op.contentEquals("<") && !g[b][a]) { g[b][a]=true; if (!removed[a] && !removed[b]) ++out_deg[b]; } } } } void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));} }