class program
{
   define pickAll()
       {
           while(nextToABeeper)
               pickbeeper();
       }
    define faceWest()
        {
            while(notFacingWest)
                turnleft();
        }

    define faceEast()
        {
            while(notFacingEast)
                turnleft();
        }


    define cleanLine()
        {
            faceEast();
            while(frontIsClear)
                move();
            faceWest();
            pickAll();
            while(frontIsClear)
                {
                    move();
                    pickAll();
                }
            faceEast();
            while(leftIsBlocked && frontIsClear)
                move();
             turnleft();
         }

    program()
        {
            cleanLine();
            while(frontIsClear)
                {
                   move();
                   cleanLine();
                }
            while(anyBeepersInBeeperBag)
               putbeeper();
            turnoff();
        }

}
