spoj; solve "To and Fro"