4 public class database_gk_check
implements Runnable
{
5 static final int MAX_N
= 10000;
6 static final int MAX_M
= 100;
7 static final int MAX_W
= 80;
8 static final int MIN_CH
= 32;
9 static final int MAX_CH
= 126;
12 static PrintWriter out
;
19 assert 1 <= n
&& n
<= MAX_N
;
20 assert 1 <= m
&& m
<= MAX_M
;
22 String
[][] values
= new String
[n
][];
23 for (int i
= 0; i
< n
; i
++) {
24 String line
= in
.nextLine();
25 assert line
.length() <= MAX_W
;
26 for (char ch
: line
.toCharArray()) {
27 assert MIN_CH
<= ch
&& ch
<= MAX_CH
;
29 values
[i
] = line
.split(",");
30 for (String value
: values
[i
]) {
31 assert value
.length() > 0;
32 assert value
.charAt(0) != ' ';
33 assert value
.charAt(value
.length() - 1) != ' ';
35 assert values
[i
].length
== m
;
39 for (int c1
= 0; c1
< m
; c1
++) {
40 for (int c2
= c1
+ 1; c2
< m
; c2
++) {
41 Map
<String
, Integer
> map
= new HashMap
<String
, Integer
>();
42 for (int r1
= 0; r1
< n
; r1
++) {
43 Integer r2
= map
.put(values
[r1
][c1
] + "," + values
[r1
][c2
], r1
);
46 out
.println((r2
+ 1) + " " + (r1
+ 1));
47 out
.println((c1
+ 1) + " " + (c2
+ 1));
56 public static void main(String
[] args
) throws Exception
{
57 in
= new Scanner(new File("database.in"));
58 out
= new PrintWriter("database.out");
60 new database_gk_check().run();