Create a script that can interpret first name, last name, middle name regardless of order the name may appear. -- 2

Job ID: 32651132

Budget: $30 – $250 USD

I need a script that can read a text file of names and categorize them into first and last name.

The names can have a variety of order. I will post a few.examples

Mr. John Smith
Mike Godwin
Smith, Aaron
Toby Luke Harris
John Fitzgerald
Maguire, Thomas
Maguire Thomas

I would need those names converted in columns like so:
First Name:
John
Mike
Aaron
Toby
John
Thomas
Thomas

Last Name:
Smith
Godwin
Smith
Harris
Fitzgerald
Maguire
Maguire