162 teachers applied to be on the next space shuttle mission. The number of high school teachers was 50 more than the number of middle school teachers. How many high school and middle school teachers applied?