Finished problem 1220, just discovered the language limit. Too bored to rewrite it, so consider it good.