Added solution for To and Fro Problem