Playing with Matches

CodeChef - MATCHES