<?php
  $input = preg_split('/ /', trim(fgets(STDIN)));
  $n = $input[0];
  $m = $input[1];
  $nArray = array();
  $mArray = array();
  $stationMap = array();
  $trainMap = array();
  $array = array();

   for($p = 0; $p < $n+1; $p++){
       $nArray[$p] = 0;
   }

   for($q = 0; $q < $m+1; $q++){
       $mArray[$q] = 0;
    }
  $stationMap = array($nArray,$mArray);
  $trainMap = array($nArray,$mArray);
  $array = array($nArray,$mArray);


  while ( ! feof(STDIN) ) {
    for ($j = 1; $j <= $n; $j++) {
      $line = preg_split('/ /', trim(fgets(STDIN)));
      $l = $line[0];
      $r = $line[1];
      for ($i = $l; $i <= $r; $i++) {
          $array[$j][$i]=$j;
      }
    }
  }
  for($s = 1; $s <= $m; $s++){
   for($t = 1; $t <= $n; $t++){
       if($array[$t][$s] != 0){
           $stationArray[$t][$s] = 1;
       }
   }
  }
  for($x = 1; $x <= $m; $x++){
   for($y = 1; $y <= $n; $y++){
       for($z = 1; $z <= $m; $z++){
           if($z%$x == 0 && $stationArray[$y][$z] == 1){
               $trainArray[$y][$x] = 1;
           }
       }
   }
  }
  for($u = 1; $u <= $m; $u++) {
   $cnt = 0;
   for($v = 1; $v <= $n; $v++) {
       $cnt = $cnt + $trainArray[$v][$u];
   }
   printf("%d\n",$cnt);
  }

?>