eval'p[%d,%d/c=%d,%d/-~c].min'%gets.split