And on the 6th day, there was a lot of money left.
First, I fled with the 1st hero from the neutrals, bought this hero on the same day, another hero took the artifact from him, and dismissed the hero who had just been bought.
Then, I did the same with the 2nd hero with the artifacts.
Well, and finally, I gave all the artifacts to the 3rd hero.
I read and reread the rules carefully, so, judging by everything, I didn't violate anything.
The trick turned out to be that in Heroes of Might and Magic I, you can dismiss a hero standing at the castle gates.
Charity suffereth long, and is kind; charity envieth not; charity vaunteth not itself, is not puffed up,
Doth not behave itself unseemly, seeketh not her own, is not easily provoked, thinketh no evil;
Rejoiceth not in iniquity, but rejoiceth in the truth;
Beareth all things, believeth all things, hopeth all things, endureth all things. Charity never faileth...