The student council at Central Canada Collegiate is putting up signs that show the message WELCOME TO CCC GOOD LUCK TODAY on walls around the school. Each sign is exactly $w$ characters wide, counting spaces.
The words are laid out on a sign as follows.
- As many words as possible are placed on the first line, as long as the words separated by single spaces do not exceed $w$ characters. The first word on a line starts at the leftmost position.
- When a line holds two or more words, the last word ends at the rightmost position. The leftover spaces are spread across the gaps between the words so that the gaps are as equal as possible; if they cannot all be equal, the larger gaps go on the left.
- When a line holds only one word, that word starts at the left and the remaining positions on the right are filled with spaces.
Every following line is built the same way, so each line ends up exactly $w$ characters wide.
Read the width $w$ and print the finished sign. Print a . character wherever a space would appear.