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>
#pragma comment(linker, "/STACK:134217728")
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
int x[200500];
vector<pair<int, pair<int, int> > > v[200500];
int l;
int id[200500];
int dist[200500];
pair<int, int> prev239[200500];
bool l1(int a, int b) { return x[a] < x[b]; }
bool l2(int a, int b) {
  if (dist[a] != dist[b]) return dist[a] < dist[b];
  return a < b;
}
set<int, bool (*)(int, int)> s(l2);
void add(int x, int d) {
  if (dist[x] != -1) s.erase(x);
  dist[x] = d;
  s.insert(x);
}
int oldd;
void parse(int x) {
  int d = dist[x];
  if (d < oldd) exit(0);
  oldd = d;
  for (int i = 0; i < (((int)(v[x]).size())); i++) {
    pair<int, pair<int, int> > o = v[x][i];
    int y = o.first;
    long long tmp = (long long)d + (long long)o.second.first;
    if (tmp > l || tmp < 0) tmp = l + 1;
    if (dist[y] == -1 || dist[y] > tmp) {
      add(y, tmp);
      prev239[y] = make_pair(x, o.second.second);
    }
  }
}
void go(int p) {
  memset(dist, -1, sizeof(dist));
  dist[p] = 0;
  s.insert(p);
  while (!s.empty()) {
    int x = *s.begin();
    s.erase(x);
    parse(x);
  }
}
int main() {
  cin >> n >> l;
  for (int i = 0; i < (n); i++) {
    int d, t, p;
    scanf("%d%d%d%d", &x[i], &d, &t, &p);
    x[i + n] = x[i] + d;
    x[i] -= p;
    if (x[i] < 0) x[i] = -1;
    t += p;
    if (t > l) t = l + 1;
    v[i].push_back(make_pair(i + n, make_pair(t, 1)));
  }
  x[2 * n] = 0;
  x[2 * n + 1] = l;
  for (int i = 0; i < (2 * n + 2); i++) id[i] = i;
  sort(id, id + 2 * n + 2, l1);
  for (int i = 0; i < (2 * n + 1); i++) {
    int p1 = id[i];
    int p2 = id[i + 1];
    int x1 = x[p1];
    int x2 = x[p2];
    if (x1 >= 0) {
      v[p1].push_back(make_pair(p2, make_pair(x2 - x1, 0)));
      v[p2].push_back(make_pair(p1, make_pair(x2 - x1, 0)));
    }
  }
  for (int i = 0; i < (2 * n + 2); i++)
    for (int j = 0; j < (((int)(v[i]).size())); j++)
      if (v[i][j].second.first < 0 || v[i][j].second.first > l)
        v[i][j].second.first = l + 1;
  go(2 * n);
  cout << dist[2 * n + 1] << endl;
  int cur = 2 * n + 1;
  vector<int> ans;
  int t = 0;
  while (cur != 2 * n) {
    pair<int, int> tmp = prev239[cur];
    if (tmp.second) ans.push_back(tmp.first);
    cur = tmp.first;
    t++;
    if (t > 500000) break;
  }
  cout << ((int)(ans).size()) << endl;
  reverse((ans).begin(), (ans).end());
  for (int i = 0; i < (((int)(ans).size())); i++) cout << ans[i] + 1 << ' ';
  return 0;
}