input data1 5 1 2 3 2 4 5 1 1 3 1 4 2 input data2 6 1 4 2 1 2 4 5 2 6 2 5 3 3 6 5 1
output data1 1 output data2 0