Nothing. They just pass over each other.
Is this a serious answer?
Blue subs are required to cruise 30 meters below the red subs just to avert crashes. I'm pretty sure that's real maritime law and not something I just made up.
This is humorous.