What happens to other leins when foreclosure occurs?

My house in California is currently in foreclosure. I have a 1st and a 2nd mortgage as well as a 3rd, seller note. What happens at the foreclosure auction? What happens if there isn’t enough funds to pay off the leins? What if any steps should I take?