package no043; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Scanner; import java.util.TreeSet; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); char[][] map = new char[n][]; char[][] map2 = new char[n][n]; for(int i=0;i>j) & 1) == 0 ? 'x' : 'o' ; if (nj == n-1) { ni++; nj = ni + 1; }else{ nj++; } } //矛盾のチェック for(int i2=0;i2 ts = new TreeSet<>(Collections.reverseOrder()); for(int i2=0;i2,B extends Comparable> implements Comparable>{ A a; B b; public Pair(A a,B b) { this.a = a; this.b = b; } public int compareTo(Pair o) { int comp = a.compareTo(o.a); if (comp != 0) { return comp; } return b.compareTo(o.b); } public boolean equals(Object o) { if (o instanceof Pair) { @SuppressWarnings("rawtypes") Pair p = (Pair) o; return a.equals(p.a) && b.equals(p.b); } return super.equals(o); } public int hashCode() { return a.hashCode() + b.hashCode(); } public String toString() { return "[" + a + "," + b + "]"; } public static ,D extends Comparable> Comparator> CompareA() { Comparator> comp = new Comparator>() { public int compare(Pair o1, Pair o2) { int comp = o1.a.compareTo(o2.a); if (comp != 0) { return comp; } return o1.b.compareTo(o2.b); } }; return comp; }; public static ,D extends Comparable> Comparator> CompareB() { Comparator> comp = new Comparator>() { public int compare(Pair o1, Pair o2) { int comp = o1.b.compareTo(o2.b); if (comp != 0) { return comp; } return o1.a.compareTo(o2.a); } }; return comp; }; }