# BEGIN SOLUTION
back()
while not isFacingWall():
    while (not isOverBaggle()) and (not isFacingWall()):
        forward()
    if isOverBaggle():
        pickupBaggle()
        back()
        while not isOverBaggle():
            forward()
        backward()
        dropBaggle()
        back()
        forward()
right()
forward()
left()
forward()
# END SOLUTION
