UVa 445 - Marvelous Mazes

445 - Marvelous Mazes

 * http://acm.uva.es/p/v4/445.html

Summary
Summary of the problem statement goes here.

Explanation
Explanation of the ideas behind the solution goes here.

Gotchas

 * Any points one can easily overlook?
 * The correct way to understand ambiguous formulations?

Implementations
Notes/Hints on actual implementation here.

Optimizations
Optimizations here.

Input
1T1b5T!1T2b1T1b2T!1T1b1T2b2T!1T3b1T1b1T!3T3b1T!1T3b1T1b1T!5T1*1T 11X21b1X 4X1b1X

Output
T TTTTT T T TT T T  TT T   T T TTT   T T   T T TTTTT*T XX  X XXXX X