Problem: Vasya participates in a ski race along the X axis. The start is at point 0, and the finish is at L, that is, at a distance L meters from the start in the positive direction of the axis. Vasya has been training so hard that he can run one meter in exactly one second.

Besides, there are n take-off ramps on the track, each ramp is characterized by four numbers: 

  * xi represents the ramp's coordinate 
  * di represents from how many meters Vasya will land if he goes down this ramp 
  * ti represents the flight time in seconds 
  * pi is the number, indicating for how many meters Vasya should gather speed to get ready and fly off the ramp. As Vasya gathers speed, he should ski on the snow (that is, he should not be flying), but his speed still equals one meter per second. 



Vasya is allowed to move in any direction on the X axis, but he is prohibited to cross the start line, that is go to the negative semiaxis. Vasya himself chooses which take-off ramps he will use and in what order, that is, he is not obliged to take off from all the ramps he encounters. Specifically, Vasya can skip the ramp. It is guaranteed that xi + di ≤ L, that is, Vasya cannot cross the finish line in flight.

Vasya can jump from the ramp only in the positive direction of X axis. More formally, when using the i-th ramp, Vasya starts gathering speed at point xi - pi, jumps at point xi, and lands at point xi + di. He cannot use the ramp in opposite direction.

Your task is to find the minimum time that Vasya will spend to cover the distance.

Input

The first line contains two integers n and L (0 ≤ n ≤ 105, 1 ≤ L ≤ 109). Then n lines contain the descriptions of the ramps, each description is on a single line. Each description is a group of four non-negative integers xi, di, ti, pi (0 ≤ xi ≤ L, 1 ≤ di, ti, pi ≤ 109, xi + di ≤ L).

Output

Print in the first line the minimum time in seconds Vasya needs to complete the track. Print in the second line k — the number of take-off ramps that Vasya needs to use, and print on the third line of output k numbers the number the take-off ramps Vasya used in the order in which he used them. Print each number exactly once, separate the numbers with a space. The ramps are numbered starting from 1 in the order in which they are given in the input.

Examples

Input

2 20
5 10 5 5
4 16 1 7


Output

15
1
1 

Input

2 20
9 8 12 6
15 5 1 1


Output

16
1
2 

Note

In the first sample, Vasya cannot use ramp 2, because then he will need to gather speed starting from point -3, which is not permitted by the statement. The optimal option is using ramp 1, the resulting time is: moving to the point of gathering speed + gathering speed until reaching the takeoff ramp + flight time + moving to the finish line = 0 + 5 + 5 + 5 = 15.

In the second sample using ramp 1 is not optimal for Vasya as t1 > d1. The optimal option is using ramp 2, the resulting time is: moving to the point of gathering speed + gathering speed until reaching the takeoff ramp + flight time + moving to the finish line = 14 + 1 + 1 + 0 = 16.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5, MAX_L = 1e9;
struct edge {
  int from, to, cost, id;
} sG[MAX_N + 5];
vector<edge> G[2 * MAX_N + 5];
int d[2 * MAX_N + 5], local[2 * MAX_N + 5], perv[2 * MAX_N + 5],
    id[2 * MAX_N + 5];
int n, L, a = 0, b = 0;
bool cmp_G(const edge& a, const edge& b) { return a.from < b.from; }
void solve() {
  sort(sG, sG + n, cmp_G);
  sort(local, local + a);
  for (int i = 0; i < a - 1; i++) {
    if (local[i] != local[i + 1]) local[b++] = local[i];
  }
  local[b++] = local[a - 1];
  local[b++] = L;
  edge e1, e2;
  e1.id = e2.id = 0;
  e1.to = 1;
  e1.cost = local[1] - local[0];
  e2.to = b - 1;
  e2.cost = local[b - 1] - local[b - 2];
  G[0].push_back(e1);
  G[b - 2].push_back(e2);
  for (int i = 1; i < b - 1; i++) {
    e1.to = i - 1;
    e1.cost = local[i] - local[i - 1];
    e2.to = i + 1;
    e2.cost = local[i + 1] - local[i];
    G[i].push_back(e1);
    G[i].push_back(e2);
  }
  for (int i = 0; i < n; i++) {
    int start = lower_bound(local, local + b, sG[i].from) - local;
    int end = lower_bound(local, local + b, sG[i].to) - local;
    e1.to = end;
    e1.cost = sG[i].cost;
    e1.id = sG[i].id;
    G[start].push_back(e1);
  }
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      que;
  memset(d, 0x3f, sizeof(d));
  d[0] = 0;
  que.push(pair<int, int>(0, 0));
  int to, cost;
  perv[0] = -1;
  while (!que.empty()) {
    pair<int, int> p = que.top();
    que.pop();
    int v = p.second;
    if (d[v] < p.first) continue;
    for (int i = 0; i < G[v].size(); i++) {
      edge e = G[v][i];
      if (d[e.to] > d[v] + e.cost) {
        d[e.to] = d[v] + e.cost;
        perv[e.to] = v;
        id[e.to] = e.id;
        que.push(pair<int, int>(d[e.to], e.to));
      }
    }
  }
  printf("%d\n", d[b - 1]);
  vector<int> path;
  for (int t = b - 1; t != -1; t = perv[t]) {
    if (id[t] != 0) path.push_back(id[t]);
  }
  reverse(path.begin(), path.end());
  printf("%d\n", path.size());
  for (int i = 0; i < path.size(); i++) printf("%d\n", path[i]);
}
int main() {
  int x, d, t, p, cnt = 0;
  edge e1;
  local[a++] = 0;
  scanf("%d%d", &n, &L);
  for (int i = 0; i < n; i++) {
    cnt++;
    scanf("%d%d%d%d", &x, &d, &t, &p);
    if (x - p < 0 || x + d > L || d <= t) {
      i--;
      n--;
      continue;
    }
    sG[i].from = x - p;
    sG[i].to = x + d;
    sG[i].cost = p + t;
    sG[i].id = cnt;
    local[a++] = sG[i].from;
    local[a++] = sG[i].to;
  }
  solve();
  return 0;
}