Sample input

Object2
4 3
3 2  5 2  6 1  7 1  6 3  4 7  1 1  2 1  0 0
Square
2 2
1 1  3 1  3 3  1 3  0 0
#


Sample output

Object2             6
Square              2