sets don't keep track of the order that things were added. If you care about the order, you need something other than a set. They're great for removing duplicates, which is not useful here.
This exercise looks like a good use for
This exercise looks like a good use for
zip()
. It takes in two streams and combines them, keeping the order. That's exactly what is needed here.