solution for 1f