Source: https://cse.iitkgp.ac.in/~abhij/course/theory/FLAT/Spring13/ct2-sol.pdf