NOT A TEACHER
"Rearrange" works better in this example because as you said, they've already been mixed up.
"into" would also be a better option if you are rearranging and sorting them into the correct categories.
in your last example, "their" and "the" both work equally well. :)
I hope this helped!
You can watch this channel for additional help with English: https://www.youtube.com/channel/UCD3...P3bw1Mf4w/feed
Student or Learner