Pizza Party Planning
You're hosting a festive pizza party with friends seated around a circular table, numbered from to in clockwise order. You plan to order pizzas over the course of the event. The -th pizza is cut into slices and the very first slice is handed to friend . Thereafter, each subsequent slice is passed one seat to the right (clockwise), so that slice number goes to friend .
Your task is to calculate, after all pizzas have been fully distributed, the total number of slices each friend has eaten.
Input
The first line contains two integers and .
Each of the next lines contains two integers and , describing the -th pizza.
Output
Print integers: the total slices received by friend , friend , ... , friend , in order, separated by spaces.