you should print in order from (0, 0) to (x, y) even though I can't find it explicitly stated
Misha_Dvali fixed statement. Thanks!