The second set of for loops in the script below should do what you're looking for. They're labeled...

# move files from subdirs to the parent directory

The first set creates the kind of file structure you described and there are some file listings (ls) to show what's happening.

Run the script as is from within an empty directory to verify it does what you want. Then cut out the second set of for loops and alter to use whatever directory and filename patterns you need.

The only thing unusual in this second set is the enclosure of the inner for loop inside parenthesis ( ... ). This is a convenient "bashism" that runs what's inside it in a subshell and so the cd only effects the inner for loop. If you don't want to use them, remove them and add a cd .. following the inner for loop.