Boat Commuter

The Bulgarian city of Nodnol runs a boat service to ferry its residents between
the trendy areas in which they live and the large metallic structures in which
they work on the next recession.

TFN (Transport For Nodnol) has issued  travel cards (known affectionally as
"Retsyo"), which are numbered from  to .  Each pier has a card terminal at which
passengers are required to tap "in" when starting the trip and to tap "out"
when finishing it.

As there is only one card terminal on each pier, passengers use the same device
to tap in and to tap out.

Trip cost depends on the distance travelled and is determined as follows:
itemize
if the trip started at the pier  and finished at the pier  (), then its cost is  pounds;
if the trip started somewhere and was not finished with a tap out, then it costs 100;
if the trip started and finished in the same place, then it also costs 100, as it is interpreted as an attempt to game the system.
itemize

You are given a sequence of tapping events - for each you have the pier  and card number  recorded.
You are to determine how much the transport authority should charge each of the cards
 
Input
itemize
One line containing three integer numbers: the number of piers , the number of travel cards , and the number of events  (, ).
   further lines, each describing tap events in chronological order.
  itemize
    The -th event is described by two integers  and  (, ).
  itemize
itemize

Output

Output  integers separated by spaces - the -th integer giving
the total charge to be applied to the -th card.
 
