Distribution Shift Inversion for Out-of-Distribution Prediction