How can I find the k cheapest stopovers between two airports, for a given date or range of days?

Let's say I'll be in some city x on May 5 and some other city z on May 12. I'd like to visit another city y on or around May 8 till around May 12, but I don't have any strong preference as to which city y it is.
How can I find the cheapest flight (and preferably the k cheapest flights) going through x-> y -> z, where y is chosen based on the price? In other words, how can I find the cheapest stopover between two airports, for a given date or range of days?
I tried to use Kiwi.com as shown in the screenshot below, but with such a search there is no guarantee that the first "Africa" is the same as the second "Africa" (and in practice is typically isn't).
Pictures about "How can I find the k cheapest stopovers between two airports, for a given date or range of days?"



How do I search multiple airports at once?
Tip #1: Search multiple airports to find the cheapest route between two regions on specific dates. With Google Flights you can search multiple airports by inputting up to seven departure and destination airport codes.How do I find a stopover flight?
How to book a multi-day layover for freeHow do I search multiple destinations on Google Flights?
To use this feature, simply type in the first airport code followed by a comma, and each airport code after that with a comma. Google Flights allows you to input a total of up to seven departure or destination cities! Once you've entered all the cities you want to search from or to, hit enter.How do you get the cheapest flights?
How to Book the Cheapest Flight Possible to AnywhereHOW TO FIND CHEAP FLIGHTS - My Best Tips After Booking 500+ Flights
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Anastasia Shuraeva, Liam Moore, Ron Lach, cottonbro