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 long long int MOD = 1000000007;
const long long BIG = 1446803456761533460LL;
const int Big = 336860180;
const long long int INF = LONG_LONG_MAX;
const vector<vector<long long int> > adj4({{0, 1}, {0, -1}, {1, 0}, {-1, 0}});
const vector<vector<long long int> > adj8(
    {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}});
long long int gcd(long long int a, long long int b) {
  return b == 0 ? a : gcd(b, a % b);
}
bool isprime(long long int n) {
  if (n == 2 || n == 3) return true;
  if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 6; (i - 1) * (i - 1) <= n; i += 6) {
    if (n % (i - 1) == 0 || n % (i + 1) == 0) {
      return false;
    }
  }
  return true;
}
vector<bool> sprime;
void genPrime(long long int sz) {
  sprime = vector<bool>(sz, true);
  sprime[0] = false;
  sprime[1] = false;
  for (long long int i = (2); i < (sz); ++i) {
    if (sprime[i]) {
      for (long long int j = i * i; j < sz; j += i) {
        sprime[j] = false;
      }
    }
  }
}
long long int powMod(long long int a, long long int b, long long int mod) {
  long long int n = 1;
  long long int p = a;
  while (b > 0) {
    if (b % 2 == 1) {
      n *= p;
      n %= mod;
    }
    p *= p;
    p %= mod;
    b /= 2;
  }
  return n;
}
long long int modularInverse(long long int a, long long int mod) {
  return powMod(a, mod - 2, mod);
}
long long int binarysearch(long long int l, long long int r,
                           bool (*bsfunction)(long long int)) {
  while (r - l > 1) {
    long long int mid = (l + r) / 2;
    bool val = bsfunction(mid);
    if (val) {
      r = mid;
    } else {
      l = mid;
    }
  }
  return l;
}
stringstream sss;
const long long int maxn = 100010;
map<long long int, vector<pair<long long int, long long int> > > g;
map<long long int, long long int> d;
map<long long int, pair<long long int, long long int> > par;
long long int W[maxn];
void MAIN() {
  long long int n, L;
  cin >> n >> L;
  g[0].clear();
  g[L].clear();
  for (long long int i = 0; i < (n); ++i) {
    long long int x, d, t, p;
    cin >> x >> d >> t >> p;
    if (x - p >= 0) g[x - p].push_back(make_pair(x + d, -i));
    g[x + d];
    W[i] = t + p;
  }
  for (auto x = g.begin(); x != g.end(); ++x) {
    if (x->first != L) {
      long long int xx = x->first;
      ++x;
      long long int yy = x->first;
      --x;
      x->second.push_back(make_pair(yy, yy - xx));
      ++x;
      x->second.push_back(make_pair(xx, yy - xx));
      --x;
    }
    d[x->first] = BIG;
  }
  set<pair<long long int, long long int> > st;
  d[0] = 0;
  st.insert(make_pair(d[0], 0));
  while (!st.empty()) {
    long long int x = st.begin()->second;
    st.erase(st.begin());
    for (auto y : g[x]) {
      long long int v = y.first;
      long long int w = y.second > 0 ? y.second : W[-y.second];
      if (d[x] + w < d[v]) {
        st.erase(make_pair(d[v], v));
        d[v] = d[x] + w;
        par[v] = make_pair(x, y.second > 0 ? -1 : -y.second);
        st.insert(make_pair(d[v], v));
      }
    }
  }
  vector<long long int> p;
  long long int x = L;
  while (x != 0) {
    if (par[x].second != -1) {
      p.push_back(par[x].second);
    }
    x = par[x].first;
  }
  cout << (d[L]) << endl;
  cout << (p.size()) << endl;
  if (p.empty()) return;
  for (long long int i = p.size() - 1; i >= 0; --i) {
    cout << p[i] + 1 << ' ';
  }
  cout << endl;
}
const long long int TESTCASEN = 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  sss << R"(
1 20
2 1 10 1
2 20
9 8 12 6
15 5 1 1
2 20
5 10 5 5
4 16 1 7
    )";
  for (long long int i = 0; i < (TESTCASEN); ++i) {
    MAIN();
  }
  return 0;
}