Use Scrolls of Wish or Limited Wish
The Wish scrolls cost 28,825 gp and allow you to:
Duplicate any wizard or sorcerer spell of 8th level or lower, provided the spell is not of a school prohibited to you.
Duplicate any other spell of 6th level or lower, provided the spell is not of a school prohibited to you.
Duplicate any wizard or sorcerer spell of 7th level or lower even if it’s of a prohibited school.
Duplicate any other spell of 5th level or lower even if it’s of a prohibited school.
The Limited Wish scrolls cost 3,775 gp and allow you to:
Duplicate any sorcerer/wizard spell of 6th level or lower, provided the spell is not of a school prohibited to you.
Duplicate any other spell of 5th level or lower, provided the spell is not of a school prohibited to you.
Duplicate any sorcerer/wizard spell of 5th level or lower, even if it’s of a prohibited school.
Duplicate any other spell of 4th level or lower, even if it’s of a prohibited school.
It's not "the best" answer, but you can cast any of these things at your own Caster Level (probably 20) and allow you to cast any spell up to 6th level, assuming you are a Generalist.
(You could also just them as a spell, but then they costs XP to use)