Syntax
n q com0 x0 y0 com1 x1 y1 ... comq-1 xq-1 yq-1
based on
AOJ DSL_2_A