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

import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) throws IOException {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					try {
						if (new File("input.txt").exists())
							System.setIn(new FileInputStream("input.txt"));
					} catch (SecurityException e) {}
					
					long prevTime = System.currentTimeMillis();
					new Main().run();
					System.err.println("Total time: " + (System.currentTimeMillis() - prevTime) + " ms");
					System.err.println("Memory status: " + memoryStatus());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "1", 1L << 24).start(); 
	}

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
		in.close();
	}
	
	/*************************************************************** 
	 * Solution
	 **************************************************************/
	
	final long INF = Long.MAX_VALUE / 7L;
	
	final int MAXV = 2 * 100000;
	final int MAXE = 4 * MAXV;
	
	int vNum = 0;
	TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();
	MultiList g = new MultiList(MAXV, MAXE);
	
	boolean[] used;
	long[] dist;
	int[] prev;
	int[] tramp;
	RMQ rmq;
	
	void solve() throws IOException  {
		int n = nextInt();
		int L = nextInt();
		v(0);
		v(L);
		for (int i = 0; i < n; i++) {
			int x = nextInt();
			int d = nextInt();
			int t = nextInt();
			int p = nextInt();
			if (x - p >= 0) {
				g.add(v(x - p), v(x + d), i + 1, t + p);
			}
		}
		Entry<Integer, Integer> prevEntry = null;
		for (Entry<Integer, Integer> curEntry : map.entrySet()) {
			if (prevEntry != null) {
				int u = prevEntry.getValue();
				int v = curEntry.getValue();
				long dist = abs(prevEntry.getKey() - curEntry.getKey());
				g.add(u, v, -1, dist);
				g.add(v, u, -1, dist);
			}
			prevEntry = curEntry;
		}
		
		long dist = dijkstra(v(0), v(L));
		out.println(dist);
		
		List<Integer> tramps = new ArrayList<Integer>(vNum);
		
		for (int v = v(L); v != -1; v = prev[v]) {
			if (tramp[v] != -1) {
				tramps.add(tramp[v]);
			}
		}
		
		out.println(tramps.size());
		for (int i = 0; i < tramps.size(); i++) {
			out.println(tramps.get(tramps.size() - i - 1));
		}
	}

	long dijkstra(int from, int to) {
		used = new boolean [vNum];
		dist = new long [vNum];
		prev = new int [vNum];
		tramp = new int [vNum];
		rmq = new RMQ(vNum);
		fill(dist, INF);
		fill(prev, -1);
		fill(tramp, -1);
		rmq.set(0, dist[from] = 0L);
		for (;;) {
			int v = rmq.get();
			if (v == -1) {
				return INF;
			}
			if (v == to) {
				return dist[to];
			}
			used[v] = true;
			rmq.set(v, INF);
			for (int i = g.head[v]; i != 0; i = g.next[i]) {
				int nv = g.vert[i];
				long nDist = dist[v] + g.cost[i];
				if (!used[nv] && dist[nv] > nDist) {
					rmq.set(nv, dist[nv] = nDist);
					prev[nv] = v;
					tramp[nv] = g.tramp[i];
				}
			}
		}
	}

	int v(int x) {
		if (!map.containsKey(x)) {
			map.put(x, vNum++);
		}
		return map.get(x);
	}
	
	class RMQ {
		long[] val;
		int[] ind;
		int n;
		
		RMQ(int size) {
			n = size;
			val = new long [2 * n];
			ind = new int [2 * n];
			fill(val, INF);
			for (int i = 0; i < n; i++) {
				ind[i + n] = i;
			}
		}
		
		void set(int index, long value) {
			val[index += n] = value;
			for (int v = index >> 1; v > 0; v >>= 1) {
				int l = v << 1;
				int r = l + 1;
				if (val[l] < val[r]) {
					val[v] = val[l];
					ind[v] = ind[l];
				} else {
					val[v] = val[r];
					ind[v] = ind[r];
				}
			}
		}
		
		int get() {
			return val[1] == INF ? -1 : ind[1];
		}
	}
	
	class MultiList {
		int[] head;
		int[] next;
		int[] vert;
		int[] tramp;
		long[] cost;
		int cnt = 1;
		
		MultiList(int vNum, int eNum) {
			head = new int [vNum];
			next = new int [eNum + 1];
			vert = new int [eNum + 1];
			tramp = new int [eNum + 1];
			cost = new long [eNum + 1];
		}
		
		void add(int u, int v, int t, long w) {
			next[cnt] = head[u];
			vert[cnt] = v;
			tramp[cnt] = t;
			cost[cnt] = w;
			head[u] = cnt++;
		}
	}
	
	/*************************************************************** 
	 * Input 
	 **************************************************************/
	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	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());
	}
	
	int[] nextIntArray(int size) throws IOException {
		int[] ret = new int [size];
		for (int i = 0; i < size; i++)
			ret[i] = nextInt();
		return ret;
	}
	
	long[] nextLongArray(int size) throws IOException {
		long[] ret = new long [size];
		for (int i = 0; i < size; i++)
			ret[i] = nextLong();
		return ret;
	}
	
	double[] nextDoubleArray(int size) throws IOException {
		double[] ret = new double [size];
		for (int i = 0; i < size; i++)
			ret[i] = nextDouble();
		return ret;
	}
	
	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;
	}
	
	/*************************************************************** 
	 * Output 
	 **************************************************************/
	void printRepeat(String s, int count) {
		for (int i = 0; i < count; i++)
			out.print(s);
	}
	
	void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}
	
	void printArray(long[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}
	
	void printArray(double[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}
	
	void printArray(double[] array, String spec) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.printf(Locale.US, spec, array[i]);
		}
		out.println();
	}
	
	void printArray(Object[] array) {
		boolean blank = false;
		for (Object x : array) {
			if (blank) out.print(' '); else blank = true;
			out.print(x);
		}
		out.println();
	}
	
	@SuppressWarnings("rawtypes")
	void printCollection(Collection collection) {
		boolean blank = false;
		for (Object x : collection) {
			if (blank) out.print(' '); else blank = true;
			out.print(x);
		}
		out.println();
	}
	
	/*************************************************************** 
	 * Utility
	 **************************************************************/
	static String memoryStatus() {
		return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory() >> 20) + "/" + (Runtime.getRuntime().totalMemory() >> 20) + " MB";
	}
	
	static void checkMemory() {
		System.err.println(memoryStatus());
	}
	
	static long prevTimeStamp = Long.MIN_VALUE;
	
	static void updateTimer() {
		prevTimeStamp = System.currentTimeMillis();
	}
	
	static long elapsedTime() {
		return (System.currentTimeMillis() - prevTimeStamp);
	}
	
	static void checkTimer() {
		System.err.println(elapsedTime() + " ms");
	}
}