On Sunday, Farmer John took Anne to the carnival. Anne's favorite ride is on the Motorcycle Circuit. As she waited in line, she noticed that there were two types of vehicles: motorcycles (2 wheels) and motorcycles wit sidecar ( 3 wheels). She counted 12 vehicles and 31 wheels. How many of each type of vehicle are on the ride?