Today the North Pole hosts an Olympiad in a sport called... toy igloo skyscrapers' building!

There are n walruses taking part in the contest. Each walrus is given a unique number from 1 to n. After start each walrus begins to build his own igloo skyscraper. Initially, at the moment of time equal to 0, the height of the skyscraper i-th walrus is equal to ai. Each minute the i-th walrus finishes building bi floors.

The journalists that are reporting from the spot where the Olympiad is taking place, make q queries to the organizers. Each query is characterized by a group of three numbers li, ri, ti. The organizers respond to each query with a number x, such that:

1. Number x lies on the interval from li to ri inclusive (li ≤ x ≤ ri).

2. The skyscraper of the walrus number x possesses the maximum height among the skyscrapers of all walruses from the interval [li, ri] at the moment of time ti.

For each journalists' query print the number of the walrus x that meets the above-given criteria. If there are several possible answers, print any of them.

Input

The first line contains numbers n and q (1 ≤ n, q ≤ 105). Next n lines contain pairs of numbers ai, bi (1 ≤ ai, bi ≤ 109). Then follow q queries i the following format li, ri, ti, one per each line (1 ≤ li ≤ ri ≤ n, 0 ≤ ti ≤ 106). All input numbers are integers.

Output

For each journalists' query print the number of the walrus x that meets the criteria, given in the statement. Print one number per line.

Examples

Input

5 4
4 1
3 5
6 2
3 5
6 5
1 5 2
1 3 5
1 1 0
1 5 0


Output

5
2
1
5


Input

5 4
6 1
5 1
2 5
4 3
6 1
2 4 1
3 4 5
1 4 5
1 2 0


Output

3
3
3
1
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, q, l, r, t;
struct PT {
  int x, y;
  int idx;
  bool operator<(const PT& p) const {
    return make_pair(x, y) < make_pair(p.x, p.y);
  }
};
vector<PT> tree[N << 2];
bool bad(PT a, PT b, PT c) {
  return 1ll * (b.y - c.y) * (b.x - a.x) <= 1ll * (a.y - b.y) * (c.x - b.x);
}
void build(int node, int s, int e) {
  if (s == e) {
    tree[node].resize(1);
    scanf("%d%d", &tree[node][0].y, &tree[node][0].x);
    tree[node][0].idx = s;
  } else {
    int md = (s + e) >> 1;
    build(node << 1, s, md);
    build(node << 1 | 1, md + 1, e);
    vector<PT> v(tree[node << 1].size() + tree[node << 1 | 1].size());
    merge(tree[node << 1].begin(), tree[node << 1].end(),
          tree[node << 1 | 1].begin(), tree[node << 1 | 1].end(), v.begin());
    for (auto& x : v) {
      while (tree[node].size() >= 2 &&
             bad(tree[node][tree[node].size() - 2], tree[node].back(), x))
        tree[node].pop_back();
      tree[node].push_back(x);
    }
  }
}
using ll = long long;
ll f(int node, int idx, int x) {
  return 1ll * tree[node][idx].x * x + tree[node][idx].y;
}
pair<ll, int> qry(int node, int s, int e, int l, int r, int x) {
  if (r < s || e < l) return make_pair(-1e18, -1);
  if (l <= s && e <= r) {
    int lo = 0, hi = tree[node].size() - 1;
    while (lo < hi) {
      int md = (lo + hi) / 2;
      if (f(node, md, x) < f(node, md + 1, x))
        lo = md + 1;
      else
        hi = md;
    }
    return make_pair(f(node, lo, x), -tree[node][lo].idx);
  }
  int md = (s + e) >> 1;
  return max(qry(node << 1, s, md, l, r, x),
             qry(node << 1 | 1, md + 1, e, l, r, x));
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  build(1, 1, n);
  while (m--) {
    int l, r, x;
    scanf("%d%d%d", &l, &r, &x);
    printf("%d\n", -qry(1, 1, n, l, r, x).second);
  }
  return 0;
}
