#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, w, mxb, mxa, bel[N], nn, cnt[350], q[350][350], qh[350], qt[350];
long long d[N];
struct data {
  int a, b;
  friend bool operator<(data a, data b) { return a.b < b.b; }
} A[N];
inline double slope(int i, int j) { return (d[i] - d[j]) * 1.0 / (j - i); }
inline void gao(int i, int x) {
  while (qh[i] < qt[i] && slope(q[i][qh[i]], q[i][qh[i] + 1]) <= x) ++qh[i];
}
inline void rebuild(int id, int l, int r) {
  qh[id] = 1;
  qt[id] = 0;
  for (int i = l; i <= r; ++i) {
    while (qh[id] < qt[id] &&
           slope(q[id][qt[id]], i) < slope(q[id][qt[id] - 1], q[id][qt[id]]))
      --qt[id];
    q[id][++qt[id]] = i;
  }
  gao(id, 0);
}
inline void add(int x) {
  if (!x) return;
  for (int i = 1; i < bel[x]; ++i) gao(i, ++cnt[i]);
  int l = (bel[x] - 1) * nn + 1, r = min(bel[x] * nn, mxa), id = bel[x];
  for (int i = l; i <= r; ++i) d[i] += (long long)cnt[id] * i;
  for (int i = l; i <= x; ++i) d[i] += i;
  cnt[id] = 0;
  rebuild(id, l, r);
}
int main() {
  scanf("%d%d", &n, &w);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &A[i].a, &A[i].b);
    mxb = max(mxb, A[i].b), mxa = max(mxa, A[i].a);
  }
  sort(A + 1, A + n + 1);
  int now = 1;
  nn = sqrt(mxa);
  for (int i = 1; i <= mxa; ++i) bel[i] = (i - 1) / nn + 1;
  int tot = bel[mxa];
  for (int i = 1; i <= tot; ++i) qh[i] = 1, q[i][++qt[i]] = min(i * nn, mxa);
  int flag = 0;
  for (int c = 0; c <= mxb + 1; ++c) {
    while (now <= n && A[now].b < c) add(A[now].a), ++now;
    long long ans = 0;
    int ans1 = 0;
    for (int i = 1; i <= tot; ++i) {
      int x = q[i][qh[i]];
      if (d[x] + (long long)x * cnt[i] > ans)
        ans = d[x] + (long long)x * cnt[i], ans1 = x;
    }
    printf("%I64d %d\n", ans + (long long)w * c * (n - now + 1), ans1);
    if (c == 1) flag = ans + (long long)w * c * (n - now + 1);
  }
  return 0;
}
