Farmer John's cows, conveniently numbered , are all standing in a row (they seem to do so often that it now takes very little prompting from Farmer John to line them up). Each cow has a breed ID: for Holsteins, for Guernseys, and for Jerseys. Farmer John would like your help counting the number of cows of each breed that lie within certain intervals of the ordering.
The first line contains and .
The next lines contain an integer that is either or , giving the breed ID of a single cow in the ordering.
The next lines describe a query in the form of two integers .
For each of the queries , print a line containing three numbers: the number of cows numbered that are Holsteins (breed ), Guernseys (breed ), and Jerseys (breed ).