Solve UVa 10081 - Tight Words.