A retro-style solution (it seems to me easier there).
The sides have three captures each. Everything is clear with the c8 and f1 bishops. One capture is made by pawns (you can immediately forget about them). It is realistic to return only one white piece (knight) and one black piece (queen or rook) to the game.
And two kings must be freed. It's complicated down there. Let's start from the top. Here we need one white knight on b8. The black rook can give it to us. But not on c8. If the knight comes to b8 from the outside (from a6, for example), black will fall into the retropath.
Therefore, for example, so:
- ... Rb8-c8 2. Ra2-a1 Rc8xNb8 3. Ka8-a7 Nc6-d8 4. Ka7-a8 Ne5-c6+
Further: bRc8-g8-g7; wNc6; wKa7-e7-f6
You can move on to the lower house. It will be more difficult here:
bNe5-c2-e1; bKf2-f1; wNc6-h3
- ... Bc5-g1 2. Ng1-h3+ Rg8-g7
We got Black Bishop out. But now how to remove the knight on h3? With the king on f1, there will be an impossible check from the queen, with the king on f2, there will be an impossible check from the knight himself. The only way is to leave, leaving a black figure in his place. And this, of course, is not a rook. So, the queen.
- Nh3xQg1 Kf2-f1 4. Nf4-h3 Nc2-e1 5. Ke5-f6 Nd4-c2 6. Nd5-f4 e7-e6 7. Ne3-d5 Ne6-d4 8. Nc2-e3 Ng5-e6 9. Ke4-e5 Nh3-g5+ 10. ~~ Qe1-g1 11. ~~ Ng1-h3 12. ~~ Kf1-f2 13. ~~ Qg3-e1 14. Ne1-c2+ Kf2-f1 15. Nc2-e1 Nh3-g1 16. Rg1-d1 ~~ 17. Ne3-c2 Ke1-f2 18. Nf1-e3+
The Black King is going home. Then you can return c2xRd3. The black rook goes to a8. You can return a7xNb6.