Hi there,
This will be a one-time-run flow, right? Because you're just doing this once.
So you can use a manual flow.
First action: Get Items. Set Order By to ID asc. Set Top Count to 50.

Then you're going to do "Stop Sharing an Item or File" and point it at the "ID" from your Get Items. It's going to turn into an Apply to Each. That's what you want.
Add another action, Grant Access to an Item or Folder, in the same Apply to Each. In ID, use the same ID from Get Items as before, it'll be in your Dynamic Content. You will need to specific your recipients, (who will receive the Read permissions - you could use an Azure group for this, rather than one-by-one), and the Permission, "Can View". You can choose whether to notify them or not.
It'll look like this:

That's it for THAT part. Now, outside of that Apply to Each, we're going to get all IDs that are after 50.
We'll use another Get Items, but this time we will use different queries.
This time we'll use Filter Query and say "only return IDs greater than 50." In the filter query, that looks like this: ID gt 50.

Then you're going to do the exact same thing as before. Add a "Stop Sharing" action, point it at the ID from your new Get Items (i recommend renaming these - like, "Get Items - After 50" - so it's easer to identify.) It will turn into an Apply to Each. Add the Grant Access action, point at that same ID again, and this time select "Can Edit". That's Contribute.
That'll do it.