test.input 35 B

123456
  1. 3 4
  2. 4 3
  3. 2 5
  4. 1 3
  5. 3 9
  6. 3 3