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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.Override;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Artem Gilmudinov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Reader in = new Reader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        int n;
        int L;

        public void solve(int testNumber, Reader in, PrintWriter out) {
            n = in.ni();
            L = in.ni();
            TaskD.Hill[] hillsByX = new TaskD.Hill[n];
            TaskD.Hill[] hillsByD = new TaskD.Hill[n];
            for (int i = 0; i < n; i++) {
                hillsByX[i] = new TaskD.Hill(in.ni(), in.ni(), in.ni(), in.ni(), i);
                hillsByD[i] = hillsByX[i];
            }
            if (n == 0) {
                out.println(L);
                out.println(0);
                return;
            }
            Arrays.sort(hillsByX, new Comparator<TaskD.Hill>() {

                public int compare(TaskD.Hill o1, TaskD.Hill o2) {
                    return o1.x - o2.x;
                }
            });
            Arrays.sort(hillsByD, new Comparator<TaskD.Hill>() {

                public int compare(TaskD.Hill o1, TaskD.Hill o2) {
                    return o1.x + o1.d - o2.x - o2.d;
                }
            });
            int[] posInD = new int[n];
            for (int i = 0; i < n; i++) {
                posInD[hillsByD[i].id] = i;
            }

            TaskD.SegmentTree st = new TaskD.SegmentTree(n, new Comparator<Hill>() {
                @Override
                public int compare(Hill o1, Hill o2) {
                    return (o1.r + o1.dist - (o2.r + o2.dist)) < 0 ? -1 : 1;
                }
            });
            TaskD.SegmentTree st1 = new TaskD.SegmentTree(n, new Comparator<Hill>() {
                @Override
                public int compare(Hill o1, Hill o2) {
                    return o1.r + o1.x + o1.d - (o2.r + o2.x + o2.d) < 0 ? -1 : 1;
                }
            });
            int[] prev = new int[n];
            Arrays.fill(prev, -1);
            int left, right, mid, temp;
            TaskD.Hill hill, curHill;
            for (int i = 0; i < n; i++) {
                left = 0;
                right = n - 1;
                curHill = hillsByX[i];
                temp = curHill.x;
                if (curHill.x - curHill.p < 0) {
                    continue;
                }
                while (left < right) {
                    mid = left + (right - left) / 2;
                    hill = hillsByD[mid];
                    if (hill.d + hill.x <= curHill.x - curHill.p) {
                        left = mid + 1;
                    } else {
                        right = mid;
                    }
                }
                if (hillsByD[left].x + hillsByD[left].d > curHill.x - curHill.p) {
                    left--;
                }
                if (left >= 0) {
                    hill = st.get(0, st.len - 1, 0, left, 0);
                    if (hill.id == -1) {
                        curHill.r = temp + curHill.t;
                    } else {
                        if (hill.r + curHill.t + (curHill.x - hill.x - hill.d) < temp + curHill.t) {
                            curHill.r = hill.r + curHill.t + (curHill.x - hill.x - hill.d);
                            prev[curHill.id] = hill.id;
                        } else {
                            curHill.r = temp + curHill.t;
                        }
                    }

                } else {
                    curHill.r = temp + curHill.t;
                }
                if(left + 1 < n) {
                    hill = st1.get(0, st.len - 1, left + 1, n - 1, 0);
                    if(hill.id != -1) {
                        if(hill.r + (hill.x + hill.d - (curHill.x - curHill.p)) + curHill.p + curHill.t < curHill.r) {
                            curHill.r = hill.r + (hill.x + hill.d - (curHill.x - curHill.p)) + curHill.p + curHill.t;
                            prev[curHill.id] = hill.id;
                        }
                    }
                }
                st.update(0, st.len - 1, posInD[curHill.id], 0, curHill);
                st1.update(0, st.len - 1, posInD[curHill.id], 0, curHill);
            }
            int min = Integer.MAX_VALUE;
            int ind = 0;
            for (int i = 0; i < n; i++) {
                if (hillsByX[i].x - hillsByX[i].p < 0) {
                    if (min > L) {
                        min = L;
                        ind = hillsByX[i].id;
                    }
                } else {
                    if (min > hillsByX[i].r + (L - hillsByX[i].x - hillsByX[i].d)) {
                        min = (int) (hillsByX[i].r + (L - hillsByX[i].x - hillsByX[i].d)); //?
                        ind = hillsByX[i].id;
                    }
                }
            }
            if (min >= L) {
                out.println(L);
                out.println(0);
                return;
            }
            ArrayList<Integer> ans = new ArrayList<>();
            while (ind != -1) {
                ans.add(ind + 1);
                ind = prev[ind];
            }

            out.println(min);
            out.println(ans.size());
            for (int i = ans.size() - 1; i >= 0; i--) {
                out.print(ans.get(i) + " ");
            }

        }

        class Hill implements ID {
            int x;
            int d;
            int t;
            int p;
            int id;
            int dist;
            long r;

            public Hill(int x, int d, int t, int p, int id) {
                this.x = x;
                this.d = d;
                this.t = t;
                this.p = p;
                this.id = id;
                this.dist = L + 100 - x - d;
            }

            public String toString() {
                return String.format("x=%d; d=%d; t=%d; p=%d; id=%d; r=%d", x, d, t, p, id, r);
            }


            public int getID() {
                return id;
            }

        }

        class SegmentTree {
            TaskD.Hill[] b;
            int len;
            Comparator<Hill> cmp;
            TaskD.Hill fake = new TaskD.Hill(0, 0, 0, 0, -1);

            public SegmentTree(int size, Comparator<Hill> cmp) {
                fake.r = 1_000_000_0000L;
                this.cmp = cmp;
                len = 1;
                while (len < size) {
                    len <<= 1;
                }
                b = new TaskD.Hill[len * 2 - 1];
                for (int i = 0; i < b.length; i++) {
                    b[i] = fake;
                }
            }

            public TaskD.Hill get(int t_l, int t_r, int q_l, int q_r, int node) {
                if (q_l > q_r) {
                    return fake;
                }
                if (t_l == q_l && t_r == q_r) {
                    return b[node];
                }
                int mid = t_l + (t_r - t_l) / 2;
                TaskD.Hill left = get(t_l, mid, q_l, Math.min(q_r, mid), node * 2 + 1);
                TaskD.Hill right = get(mid + 1, t_r, Math.max(q_l, mid + 1), q_r, node * 2 + 2);
                if(cmp.compare(left, right) <= 0) {
                    return left;
                } else {
                    return right;
                }
            }

            public void update(int l, int r, int x, int node, TaskD.Hill hill) {
                if (l == r) {
                    b[node] = hill;
                    return;
                }
                int mid = l + (r - l) / 2;
                if (x <= mid) {
                    update(l, mid, x, node * 2 + 1, hill);
                } else {
                    update(mid + 1, r, x, node * 2 + 2, hill);
                }
                TaskD.Hill left = b[node * 2 + 1];
                TaskD.Hill right = b[node * 2 + 2];
                if(cmp.compare(left, right) <= 0) {
                    b[node] = left;
                } else {
                    b[node] = right;
                }
            }

        }

    }

    static class Reader {
        private BufferedReader in;
        private StringTokenizer st = new StringTokenizer("");
        private String delim = " ";

        public Reader(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            if (!st.hasMoreTokens()) {
                st = new StringTokenizer(rl());
            }
            return st.nextToken(delim);
        }

        public String rl() {
            try {
                return in.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int ni() {
            return Integer.parseInt(next());
        }

    }

    static interface ID {
        int getID();

    }
}