Solution for 1029 ("Ministry"). Accepted with clang 3.5. With VS2013 compiles, but doesn't produce any output.