Your task is to format an address given in all lowercase to a friendlier format. Here's the catch, no regexes.
Addresses will be given in the following format:
123 serpentine pl ne shoreline wa 98199
The expected output is the following: (notice the period and commas)
123 Serpentine Pl. NE, Shoreline WA, 98199
Cardinal directions should be capitalized, e.g. "e" --> "E", "nw" --> "NW".
Abbreviations for streets, avenues, etc. should have the first letter capitalized with the abbr. followed by a period (".") e.g "st" --> "St.", "ave" --> "Ave.".
State abbreviation should be in all caps
A comma is placed after each section. i.e. after the street address and state and city.
Capitalize the city and street/avenue/place.
EDIT: Addresses will always be given in the above format except with or without a cardinal direction.
Your code should also be able to handle "st" and "ave". The input is given through
stdin. This is code-golf so the shortest code in bytes wins.