solves medium puzzzles