Console Output

solve the corner case of the horizontal 1