class program {
void wall()
{
  while(frontIsClear())
    move();
}
void t180()
{
  turnleft();
  turnleft();
}
void w()
{
  while(notFacingWest)
    turnleft();
}
void find()
{
  w();
  wall();
  t180();
  while(leftIsBlocked() && frontIsClear())
    move();
  turnleft();
}
void pb()
{
  w();
  wall();
  t180();
  if(nextToABeeper())
    pickbeeper();
  while(frontIsClear())
  {
    move();
    if(nextToABeeper())
      pickbeeper();
  }
}
program() {
    pb();
    find();
    while(frontIsClear())
    {
      move();
      pb();
      find();
    }
    putbeeper();
    turnoff();
}

}
