Ryan played in 3 basketball games. He scored 18 points in the first game and 12 points in the second game. If he scored 42 points in all games combined, how many points did he score in the third game?