Solution by David Kayal
