Write a program that reads full names, one per line, and then prints them in the standard telephone directory format. For example, the input
Johann Sebastian Bach George Frederic Handel Carl Phillipp Emanuel Bach Joseph Haydn
Johann Christian Bach Wolfgang Amadeus Mozart
would be printed as: Bach, Johann S. Handel, George F. Bach, Carl P. E.
Haydn, Joseph Bach, Johann C. Mozart, Wolfgang A.