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.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;

public class Solution {
  public static void main(String[] args) {
    try (Scanner sc = new Scanner(System.in)) {
      int n = sc.nextInt();
      int len = sc.nextInt();
      List<Ramp> ramps = new ArrayList<>(n);
      for (int i = 0; i < n; ++i) {
        int x = sc.nextInt();
        int d = sc.nextInt();
        int t = sc.nextInt();
        int p = sc.nextInt();
        ramps.add(new Ramp(x, d, t, p, i + 1));
      }

      Result result = solve(len, ramps);
      System.out.println(result.time);
      System.out.println(result.usedRamps.size());
      if (!result.usedRamps.isEmpty()) {
        System.out.println(result.usedRamps.stream()
            .map(Object::toString)
            .collect(Collectors.joining(" ")));
      }
    }
  }

  private static Result solve(int len, List<Ramp> ramps) {
    // Filter out invalid ramps.
    ramps = ramps.stream()
        .filter(x -> x.getStart() >= 0)
        .filter(x -> x.getEnd() <= len)
        .filter(x -> x.getTime() < x.getDist())
        .collect(Collectors.toList());
    
    // List up all the vertices.
    Set<Integer> verticesSet = new TreeSet<>();
    verticesSet.add(0);
    verticesSet.add(len);
    for (Ramp ramp : ramps) {
      verticesSet.add(ramp.getStart());
      verticesSet.add(ramp.getEnd());
    }
    List<Integer> vertices = verticesSet.stream().collect(Collectors.toList());

    // List up all the edges.
    Map<Integer, List<Edge>> edges = new HashMap<>();
    for (int i = 0; i < vertices.size() - 1; ++i) {
      int start = vertices.get(i);
      int end = vertices.get(i + 1);
      int time = end - start;
      edges.putIfAbsent(start, new ArrayList<>());
      edges.get(start).add(new Edge(start, end, time, 0));
      edges.putIfAbsent(end, new ArrayList<>());
      edges.get(end).add(new Edge(end, start, time, 0));
    }
    for (Ramp ramp : ramps) {
      int start = ramp.getStart();
      int end = ramp.getEnd();
      int time = ramp.getTime();
      int rampIndex = ramp.getRampIndex();
      edges.putIfAbsent(start, new ArrayList<>());
      edges.get(start).add(new Edge(start, end, time, rampIndex));
    }

    // Run Dijkstra's shortest path algorithm.
    Map<Integer, QueueElem> elements = new HashMap<>();
    for (int pos : vertices) {
      int time = pos == 0 ? 0 : Integer.MAX_VALUE;
      elements.put(pos, new QueueElem(pos, time));
    }

    PriorityQueue<QueueElem> queue = new PriorityQueue<>();
    queue.add(elements.get(0));

    while (!queue.isEmpty()) {
      QueueElem elem = queue.poll();
      elem.processed = true;

      if (elem.pos == len) {
        // Found the solution.
        List<Integer> usedRamps = elem.usedRamp != null
            ? elem.usedRamp.getPath()
            : Collections.emptyList();
        return new Result(elem.time, usedRamps);
      }

      // Find all edges from this vertex.
      for (Edge edge : edges.get(elem.pos)) {
        QueueElem endElem = elements.get(edge.end);
        if (endElem.processed) {
          continue;
        }
        
        int newTime = elem.time + edge.weight;
        if (newTime < endElem.time) {
          if (endElem.inQueue) {
            queue.remove(endElem);
          }
          endElem.time = newTime;
          if (edge.rampIndex != 0) {
            endElem.usedRamp = new UsedRamp(edge.rampIndex, elem.usedRamp);
          } else {
            endElem.usedRamp = elem.usedRamp;
          }
          endElem.inQueue = true;
          queue.add(endElem);
        }
      }
    }

    return null;
  }

  private static class Ramp {
    int x; // position
    int d; // fly distance
    int t; // time
    int p; // prep distance
    int i; // ramp index (1-based)

    public Ramp(int x, int d, int t, int p, int i) {
      this.x = x;
      this.d = d;
      this.t = t;
      this.p = p;
      this.i = i;
    }

    public int getStart() {
      return this.x - this.p;
    }

    public int getEnd() {
      return this.x + this.d;
    }

    public int getDist() {
      return getEnd() - getStart();
    }

    public int getTime() {
      return this.p + this.t;
    }

    public int getRampIndex() {
      return this.i;
    }
  }

  private static class Result {
    int time;
    List<Integer> usedRamps;

    public Result(int time, List<Integer> usedRamps) {
      this.time = time;
      this.usedRamps = Collections.unmodifiableList(usedRamps);
    }
  }

  private static class Edge {
    int start;
    int end;
    int weight;
    int rampIndex; // 1-based. 0 means it's not a ramp edge.

    public Edge(int start, int end, int weight, int rampIndex) {
      this.start = start;
      this.end = end;
      this.weight = weight;
      this.rampIndex = rampIndex;
    }
  }

  private static class QueueElem implements Comparable<QueueElem> {
    int pos;
    int time;
    boolean processed;
    boolean inQueue;
    UsedRamp usedRamp;

    public QueueElem(int pos, int time) {
      this.pos = pos;
      this.time = time;
    }

    @Override
    public int compareTo(QueueElem o) {
      if (this == o) { return 0; }

      if (this.time < o.time) { return -1; }
      if (this.time > o.time) { return 1; }

      if (this.pos < o.pos) { return -1; }
      if (this.pos > o.pos) { return 1; }

      return 0;
    }

    @Override
    public String toString() {
      String rampsStr = this.usedRamp.getPath().stream()
        .map(Object::toString)
        .collect(Collectors.joining(","));

      return "[" + this.pos + ", " + this.time + ", {" + rampsStr + "}]";
    }
  }

  private static class UsedRamp {
    int rampIndex;
    UsedRamp prev;

    public UsedRamp(int rampIndex, UsedRamp prev) {
      this.rampIndex = rampIndex;
      this.prev = prev;
    }

    public List<Integer> getPath() {
      List<Integer> result = new ArrayList<>();

      UsedRamp cur = this;
      while (cur != null) {
        result.add(cur.rampIndex);
        cur = cur.prev;
      }

      Collections.reverse(result);
      return result;
    }
  }
}