Ostap Bender recently visited frog farm and was inspired to create his own frog game.

Number of frogs are places on a cyclic gameboard, divided into m cells. Cells are numbered from 1 to m, but the board is cyclic, so cell number 1 goes right after the cell number m in the direction of movement. i-th frog during its turn can jump for ai cells.

Frogs move in turns, game starts with a move by frog 1. On its turn i-th frog moves ai cells forward, knocking out all the frogs on its way. If there is a frog in the last cell of the path of the i-th frog, that frog is also knocked out. After this the value ai is decreased by the number of frogs that were knocked out during this turn. If ai is zero or goes negative, then i-th frog doesn't make moves anymore.

After frog number 1 finishes its turn, frog number 2 starts to move, then frog number 3 and so on. After the frog number n makes its move, frog 1 starts to move again, then frog 2 and so on this process goes forever. If some frog was already knocked out from the board, we consider that it skips all its moves.

Help Ostap to identify, what frogs will stay on the board at the end of a game?

Input

First line of the input contains two integers n and m (1 ≤ n ≤ 100000, 1 ≤ m ≤ 109, n ≤ m) — number of frogs and gameboard size, respectively.

Following n lines contains frogs descriptions — two integers pi and ai (1 ≤ pi, ai ≤ m) — the number of cell occupied by i-th frog initially and initial jump length. All pi are guaranteed to be distinct.

Output

In the first line output number of frogs on the final gameboard. In the second line output their numbers in any order.

Examples

Input

3 5
2 1
5 3
4 3


Output

1
3 

Input

5 6
1 2
3 4
2 5
5 1
6 1


Output

2
1 4 

Note

In the first sample first frog jumps 1 cell and finishes in cell number 3. Second frog jumps for 3 cells and finishes on cell number 3, knocking out frog number 1. Current jump length for frog number 2 is now 2. Third frog jumps to cell 2, then second frog jumps to cell 5. Third frog in turn finishes in cell 5 and removes frog 2 from the gameboard. Now, it's the only remaining frog in the game.

In the second sample first frog jumps 2 cells and knocks out frogs in cells 2 and 3. Its value ai is now 0. Then fourth frog jumps and knocks out fifth frog and its ai is now 0 too. These two frogs will remains on the gameboard forever.
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int read() {
  int x = 0, f = 1, ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  return x * f;
}
int n, L, p[100005], a[100005], pre[100005], nxt[100005], x[100005];
bool cmp(int a, int b) { return p[a] < p[b]; }
set<pair<int, int> > st;
int dis(int i, int j) {
  if (i == j) return INF;
  register int d = (p[j] - p[i] + L) % L;
  if (i > j) d = (d + a[j]) % L;
  if (d <= a[i]) return 1;
  if (a[i] <= a[j]) return INF;
  return (d - a[j] - 1) / (a[i] - a[j]) + 1;
}
signed main() {
  n = read(), L = read();
  for (register int i = 1; i <= n; i++) {
    p[i] = read(), a[i] = read(), x[i] = i;
  }
  sort(x + 1, x + 1 + n, cmp);
  pre[x[1]] = x[n];
  for (int i = 1; i <= n; i++) {
    if (i > 1) pre[x[i]] = x[i - 1];
    nxt[pre[x[i]]] = x[i];
  }
  for (int i = 1; i <= n; i++) st.insert(make_pair(dis(i, nxt[i]), i));
  set<pair<int, int> >::iterator it;
  while (st.size()) {
    it = st.begin();
    register int i = it->second, d = it->first;
    if (d == INF) break;
    st.erase(it);
    st.erase(make_pair(dis(nxt[i], nxt[nxt[i]]), nxt[i]));
    st.erase(make_pair(dis(pre[i], i), pre[i]));
    p[i] = (p[i] + d - 1) % L + 1;
    a[i]--;
    nxt[i] = nxt[nxt[i]];
    pre[nxt[i]] = i;
    st.insert(make_pair(dis(pre[i], i), pre[i]));
    st.insert(make_pair(dis(i, nxt[i]), i));
  }
  printf("%d\n", st.size());
  while (st.size()) {
    it = st.begin();
    printf("%d ", it->second);
    st.erase(it);
  }
  return 0;
}
