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.*;
import java.util.*;

public class D {

	class Ramp {
		Ramp (int X, int D, int T, int P) {
			S = X - P;
			Y = X + D;
			TT = P + T;
		}
		public final int S, Y, TT;
	}
	
	public D () throws IOException {
		String [] S = r.readLine().split(" ");
		int N = Integer.parseInt(S[0]);
		int L = Integer.parseInt(S[1]);
		Ramp [] R = new Ramp [N];
		for (int i = 0; i < N; ++i) {
			S = r.readLine().split(" ");
			int X = Integer.parseInt(S[0]);
			int D = Integer.parseInt(S[1]);
			int T = Integer.parseInt(S[2]);
			int P = Integer.parseInt(S[3]);
			R[i] = new Ramp(X,D,T,P);
			
			if (R[i].S < 0 || R[i].TT >= R[i].Y - R[i].S)
				R[i] = null;
		}
		solve(N, L, R);
	}
	
	long M = (1L << 32) - 1;
	long key(int x, int y) {
		return M * x + y;
	}
	
	int [] dekey (long z) {
		return new int [] { (int)(z/M), (int)(z%M) };
	}
	
	void addEdge(int x, int y, int c) {
		if (!E.containsKey(x))
			E.put(x, new ArrayList<Integer>());
		E.get(x).add(y);
		G.put(key(x,y), c);		
	}
	
	public void solve (int N, int L, Ramp[] R) {
		t = millis();

		Set<Integer> points = new HashSet<Integer>();
		for (Ramp r : R)
			if (r != null) {
				points.add(r.S);
				points.add(r.Y);
			}
		points.add(0);
		points.add(L);
		
		Integer [] ps = points.toArray(new Integer[0]);
		Arrays.sort(ps);
		
		for (int i = 1; i < ps.length; ++i) {
			int x = ps[i-1], y = ps[i], d = Math.abs(x-y);
			addEdge(x,y,d);
			addEdge(y,x,d);
		}
		
		Map<Long, Integer> RS = new HashMap<Long, Integer>();
		for (int i = 0; i < R.length; ++i) {
			if (R[i] != null) {
				Ramp r = R[i];
				long k = key(r.S, r.Y);
				if (G.containsKey(k) && G.get(k) <= r.TT)
					continue;
				else {
					addEdge(r.S, r.Y, r.TT);
					RS.put(key(r.S,r.Y), i+1);
				}
			}
		}
		
		Map<Integer, Integer> vis = new HashMap<Integer, Integer>();		
		Queue<Long> Q = new PriorityQueue<Long>(1000000, new EC());
		D.put(0, 0);
		for (int v : E.get(0))
			Q.add(key(0,v));
		vis.put(0, -1);
		
		for (;;) {
			Long e = Q.poll();
			int [] xy = dekey(e);
			int x = xy[0], y = xy[1];
			if (!vis.containsKey(y)) {
				D.put(y, D.get(x) + G.get(e));
				vis.put(y, x);
				if (y == L)
					break;
				for (int v : E.get(y))
					if (!vis.containsKey(v))
						Q.add(key(y,v));
			}
		}		

		int x = L;
		List<Integer> Z = new LinkedList<Integer>();
		while (x != -1) {
			Z.add(0, x);
			x = vis.get(x);
		}

		StringBuffer B = new StringBuffer();
		int cnt = 0;
		while (Z.size () > 1) {
			long k = key(Z.get(0), Z.get(1));
			if (RS.containsKey(k)) {
				++cnt;
				B.append(" " + RS.get(k));
			}
			Z.remove(0);
		}
		
		print2(D.get(L));
		print2(cnt);
		if (cnt > 0)
			print(B.toString().trim());
	}
	
	Map<Integer, Integer> D = new HashMap<Integer, Integer>();
	Map<Integer, List<Integer>> E = new HashMap<Integer, List<Integer>>();	
	Map<Long, Integer> G = new HashMap<Long, Integer>();
	
	class EC implements Comparator<Long> {

		@Override
		public int compare(Long e1, Long e2) {
			return z(e1) - z(e2);
		}
		
		private int z(long e) {
			try {
				return D.get(dekey(e)[0]) + G.get(e);
			} catch (Exception ex) {
				throw new RuntimeException(Arrays.toString(dekey(e)));
			}
		}
	}
	
	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;
	
	static void print2 (Object o) {
		System.out.println(o);
	}
	
	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}
	
	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new D();
	}
	
	public static void main(String[] args) throws IOException {
		run();
	}
	
	static long millis() {
		return System.currentTimeMillis();
	}
}