2007 honda civic

2007 Honda Civicair conditioner starts off blowing cold air after 10 -20 minutes it blows hot air. After turning it off for a few minutes it will blow cold again. What is the problem?