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 static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.util.Map.Entry;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		in.close();
		out.close();
	}
	
	
	int [] x, dist, ti, pre;
	TreeSet<Integer> p = new TreeSet<Integer>();
	void add(int x){
		if(valid(x))
			p.add(x);
	}
	boolean valid(int x){
		return x >= 0 && x <= len;
	}
	
	int n;
	int len;
	int start = 0;
	int end;
	
	MultiList g;
	HashMap<Integer, Integer> id = new HashMap<Integer, Integer>();//[x] -> id
	int p_id = 0;
	int px[];
	
	void solve() throws IOException{
		int k = nextInt();
		len = nextInt();
		x = new int[k];
		dist = new int[k];
		ti = new int[k];
		pre = new int[k];
		
		for(int i = 0; i < k; i++){
			x[i] = nextInt();
			dist[i] = nextInt();
			ti[i] = nextInt();
			pre[i] = nextInt();
			add(x[i] - pre[i]);
			add(x[i] + dist[i]);
		}
		add(0);
		add(len);
		n = p.size();
		g = new MultiList(n, 2 * n + k + 10);
		px = new int[n];
		for(int key: p){
			px[p_id] = key;  
			id.put(key, p_id++);
		}
		start = 0;
		end = p_id - 1;
//		System.err.println(len);
//		System.err.println(Arrays.toString(px));
//		System.err.println(end);
		chk(px[end] == len);
		for(int i = 0; i < p_id - 1; i++){
			int u = i;
			int v = i + 1;
			int d = abs(px[v] - px[u]);
			g.add(u, v, d, -1);
			g.add(v, u, d, -1);
		}
		for(int i = 0; i < k; i++){
			int ux = x[i] - pre[i];
			int vx = x[i] + dist[i];
			if(!valid(ux) || !valid(vx)) continue;
			int u = id.get(ux);
			int v = id.get(vx);
			int d = pre[i] + ti[i];
			g.add(u, v, d, i + 1);
		}
		chk(dijk());
		int ans[] = new int[n];
		int p = 0;
		int cur = end;
		chk(end != start);
		do{
			if(prev_tr[cur] != -1) ans[p++] = prev_tr[cur];
			cur = prev[cur];
		} while(cur != start);
		out.println(rmq.getVal(end));
		out.println(p);
		for(int i = 0; i < p; i++){
			if(i != 0) out.print(" ");
			out.print(ans[p - i - 1]);
		}
		if(p != 0)
			out.println();
	}
	final int inf = Integer.MAX_VALUE;
	int prev[];
	int prev_tr[];
	RMQ rmq;
	boolean dijk(){
		prev = new int[p_id];
		prev_tr = new int[p_id];
		rmq = new RMQ(p_id);
		rmq.set(start, 0);
		for(int v = start; rmq.getVal(v)!= inf; v = rmq.getMin()){
//			System.err.println(v + " = " + rmq.getVal(v));
			if(v == end) return true;
			int d = rmq.getVal(v);
			rmq.set(v, inf - 1);
			for(int j = g.head[v]; j != 0; j = g.next[j]){
//				System.err.println(" to ->" + g.to[j] + " || " + g.len[j] + d + " > " + rmq.getVal(g.to[j]));
				if(rmq.renew(g.to[j], g.len[j] + d)) {
//					System.err.println(true);
					prev[g.to[j]] = v;
					prev_tr[g.to[j]] = g.tr[j];
				}
			}
//			System.err.println(rmq.getVal(0));
//			System.err.println("111 " + rmq.getMin());
		}
		return false;
	}

	class RMQ{
		int dist[];
		int id[];
		int c;
		RMQ(int size){
			c = size;
			dist = new int[c << 1];
			id = new int[c << 1];
			fill(dist, inf);
			for(int i = 0; i < c; i++)
				id[c + i] = i;
			for(int i = c - 1; i > 0; i--)
				id[i] = best(id[i << 1], id[(i << 1) + 1]);
		}
		int best(int a, int b){
			int da = getVal(a);
			int db = getVal(b);
			return da < db ? a : b;
		}
		boolean renew(int v, int di){
			v += c;
			if(dist[v] > di && dist[v] != inf - 1){
				dist[v] = di;
				relax(v);
				return true;
			}
			return false;
		}
		int getVal(int v){
			return dist[c + v];
		}
		void set(int v, int di){
			v += c;
			dist[v] = di;
			relax(v);
		}
		private void relax(int v){
			while(v > 0){
				v >>= 1;
				id[v] = best(id[v << 1], id[(v << 1) + 1]);
			}
		}
		int getMin(){
			return id[1];
		}
	}
	class MultiList{
		int[] head, next, to, len, tr;
		int cnt;
		public MultiList(int h, int s) {
			s++;
			head = new int[h];
			next = new int[s];
			to = new int[s];
			len = new int[s];
			tr = new int[s];
			cnt++;
		}
		void add(int h, int v, int le, int tramp) {
//			System.err.println("edge : " + h + " -> " + v + " " + le + " | " + f);
			to[cnt] = v;
			len[cnt] = le;
			next[cnt] = head[h];
			tr[cnt] = tramp;
			head[h] = cnt++;
		}
	}

	void chk(boolean b) {
		if (b)
			return;
		System.out.println(new Error().getStackTrace()[1]);
		exit(999);
	}
	void deb(String fmt, Object... args) {
		System.out.printf(Locale.US, fmt + "%n", args);
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}