Since no black piece can be captured before the final move, he must somehow contrive to gum up his rook and bishop, which means getting a piece to h2. But another bishop can't get there and a knight would deliver check, and any other piece would need h1 and h3 filled as well, and then what's to stop the piece on h3 from moving?
The task soon becomes like trying to stick a cork back into a bottle of frothing liquid. Eventually you realise that Black must leave his king on h5 and fill up the squares from h1 to h4 before finally playing g5 and allowing White to stalemate with Rd6.
Here's how it is done: 1.a1=Q, 2.Qxa3, 3.Qe7, 4.a3, 5.a2, 6.a1=Q, 7.Qxa5, 8.Qad8, 9.a5, 10.a4, 11.a3, 12.a2, 13.a1=Q, 14.Qxd4, 15.Qdf6, 16.d4, 17.d3, 18.dxc2, 19.c1=Q, 20.Qcxg5, 21.Qh4, 22.Qh1, 23.Qfh4, 24.Q4h2, 25.Qeh4, 26.Q4h3, 27.Qh4, 28.g5 and now Rd6 does it.
In the second position, it's just 16 moves to stalemate, but finding a way to gum up those black pawns is far from straightforward. If you fiddle around with black pieces in the corner, you'll see that the only hope is to promote four pawns to end with a rook on a2, bishop on b2 and bishop or queen on a1, with the final piece captured on the b-file. Answer: 1.b1=N 2.Nd2, 3.Nb3, 4.Kb1, 5.a1=B, 6.Bc3, 7.Be1, 8.f1=R, 9.Rf2, 10.Ra2, 11.f2, 12.f1=Q, 13.Qf6, 14.Qa1, 15.Bc3, 16.Bb2 and finally Rxb3 is stalemate. A beautiful construction.Reuse content