Coders Collaborate


In MonTech, there are MM collaborative projects, each uniquely identified from 1 to MM. Today, NN coders assemble, numbered from 1 to NN. Due to the multitude of projects, each coder will only contribute to a specific range of projects.

The ii-th coder will contribute to projects numbered aia_i-th, (ai+1)(a_i + 1)-th, ..., bib_i-th project.

You are given a task. For each coder, what is the number of other coders they are collaborating with?

Note: Two coders are collaborating if and only if, they contribute to one or more projects with the same id.

Input

The first line contains two integers, NN and MM – the number of coders and projects respectively.

The next NN lines contain two integers each aia_i, bib_i – the numbers of the projects that the ii-th coder is contributing to.

Output

NN lines, where the ii-th line contains the number of other coders that are collaboriting with the ii-th coder.

Constraints

  • 1N2×1051 \le N \le 2\times10^5
  • 1M1091 \le M \le 10^9
  • 1aibiM1 \le a_i \le b_i \le M

Example 1

Input 1
5 5
4 5
1 3
2 4
1 5
1 1
Output 1
2
3
3
4
2

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.