Given a sequence of integers a of length n, a tuple (i,j,k) is called monotone triples if 

  * 1 ≤ i<j<k≤ n; 
  * a_i ≤ a_j ≤ a_k or a_i ≥ a_j ≥ a_k is satisfied. 



For example, a=[5,3,4,5], then (2,3,4) is monotone triples for sequence a while (1,3,4) is not.

Bob is given a sequence of integers a of length n in a math exam. The exams itself contains questions of form L, R, for each of them he is asked to find any subsequence b with size greater than 2 (i.e. |b| ≥ 3) of sequence a_L, a_{L+1},…, a_{R}.

Recall that an sequence b is a subsequence of sequence a if b can be obtained by deletion of several (possibly zero, or all) elements.

However, he hates monotone stuff, and he wants to find a subsequence free from monotone triples. Besides, he wants to find one subsequence with the largest length among all subsequences free from monotone triples for every query.

Please help Bob find out subsequences meeting the above constraints.

Input

The first line contains two integers n, q (3 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ q ≤ 2 ⋅ 10^5) — the length of sequence a and the number of queries.

The second line contains n integers a_1,a_2,…, a_n (1 ≤ a_i ≤ 10^{9}), representing the sequence a.

Then each of the following q lines contains two integers L, R (1 ≤ L,R ≤ n, R-L≥ 2).

Output

For each query, output 0 if there is no subsequence b satisfying the constraints mentioned in the legend. You can print the empty line after but that's not mandatory.

Otherwise, output one integer k (k > 2) denoting the length of sequence b, then output k integers i_1, i_2, …, i_k (L ≤ i_1 < i_2<…<i_k≤ R) satisfying that b_j = a_{i_j} for 1 ≤ j ≤ k.

If there are multiple answers with the maximum length, print any of them.

Example

Input


6 2
3 1 4 1 5 9
1 3
4 6


Output


3
1 2 3 
0

Note

For the first query, the given sequence itself is monotone triples free.

For the second query, it can be shown that there is no subsequence b with length greater than 2 such that b is monotone triples free.
#include <bits/stdc++.h>
using namespace std;
int inf;
const double eps = 1e-8;
const double pi = acos(-1.0);
template <class T, class T2>
int chkmin(T &a, T2 b) {
  return a > b ? a = b, 1 : 0;
}
template <class T, class T2>
int chkmax(T &a, T2 b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T, class T2>
T mmin(T a, T2 b) {
  return a < b ? a : b;
}
template <class T, class T2>
T mmax(T a, T2 b) {
  return a > b ? a : b;
}
template <class T>
T aabs(T a) {
  return a < 0 ? -a : a;
}
template <class T>
int dcmp(T a, T b) {
  return a > b;
}
template <int *a>
int cmp_a(int first, int second) {
  return a[first] < a[second];
}
struct __INIT__ {
  __INIT__() { memset(&inf, 0x3f, sizeof(inf)); }
} __INIT___;
namespace io {
const int SIZE = (1 << 21) + 1;
char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c,
                                       qu[55];
int f, qr;
inline void flush() {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
}
inline void putc(char first) {
  *oS++ = first;
  if (oS == oT) flush();
}
template <typename A>
inline bool read(A &first) {
  for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-')
      f = -1;
    else if (c == EOF)
      return 0;
  for (first = 0; c <= '9' && c >= '0';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    first = first * 10 + (c & 15);
  first *= f;
  return 1;
}
inline bool read(char &first) {
  while ((first = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                               (iS == iT ? EOF : *iS++))
                            : *iS++)) == ' ' ||
         first == '\n' || first == '\r')
    ;
  return first != EOF;
}
inline bool read(char *first) {
  while ((*first = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                                (iS == iT ? EOF : *iS++))
                             : *iS++)) == '\n' ||
         *first == ' ' || *first == '\r')
    ;
  if (*first == EOF) return 0;
  while (!(*first == '\n' || *first == ' ' || *first == '\r' || *first == EOF))
    *(++first) = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin),
                              (iS == iT ? EOF : *iS++))
                           : *iS++);
  *first = 0;
  return 1;
}
template <typename A, typename... B>
inline bool read(A &first, B &...second) {
  return read(first) && read(second...);
}
template <typename A>
inline bool write(A first) {
  if (!first) putc('0');
  if (first < 0) putc('-'), first = -first;
  while (first) qu[++qr] = first % 10 + '0', first /= 10;
  while (qr) putc(qu[qr--]);
  return 0;
}
inline bool write(char first) {
  putc(first);
  return 0;
}
inline bool write(const char *first) {
  while (*first) {
    putc(*first);
    ++first;
  }
  return 0;
}
inline bool write(char *first) {
  while (*first) {
    putc(*first);
    ++first;
  }
  return 0;
}
template <typename A, typename... B>
inline bool write(A first, B... second) {
  return write(first) || write(second...);
}
struct Flusher_ {
  ~Flusher_() { flush(); }
} io_flusher_;
}  // namespace io
using io ::putc;
using io ::read;
using io ::write;
int a[200005], b[200005], m;
vector<int> at[200005];
int rt[200005], l[10000005], r[10000005], s[10000005], t;
void add(int &rt, int ls, int rs, int first) {
  if (!rt) rt = ++t;
  ++s[rt];
  if (ls == rs) return;
  int mid = (ls + rs) >> 1;
  if (first <= mid)
    add(rt[l], ls, mid, first);
  else
    add(rt[r], mid + 1, rs, first);
}
void fndl(int r1, int r2, int ls, int rs, int &first, int xl) {
  if (s[r1] + s[r2] == rs - ls + 1) return;
  if (rs < xl) return;
  if (ls == rs) {
    first = ls;
    return;
  }
  int mid = (ls + rs) >> 1;
  fndl(r1[l], r2[l], ls, mid, first, xl);
  if (!first) fndl(r1[r], r2[r], mid + 1, rs, first, xl);
}
void fndr(int r1, int r2, int ls, int rs, int &first, int xr) {
  if (s[r1] + s[r2] == rs - ls + 1) return;
  if (ls > xr) return;
  if (ls == rs) {
    first = ls;
    return;
  }
  int mid = (ls + rs) >> 1;
  fndr(r1[r], r2[r], mid + 1, rs, first, xr);
  if (!first) fndr(r1[l], r2[l], ls, mid, first, xr);
}
struct smt {
  int mx, mn;
  int ls, rs;
  smt *l, *r;
  smt(int la, int ra) {
    ls = la;
    rs = ra;
    if (ls == rs) {
      mx = mn = a[ls];
      l = r = 0;
      return;
    }
    int mid = (ls + rs) >> 1;
    l = new smt(ls, mid);
    r = new smt(mid + 1, rs);
    mx = mmax(l->mx, r->mx);
    mn = mmin(l->mn, r->mn);
  }
  void qry(int la, int ra, int &Mx, int &Mn) {
    if (la <= ls && rs <= ra) {
      chkmax(Mx, mx);
      chkmin(Mn, mn);
      return;
    }
    if (la <= l->rs) l->qry(la, ra, Mx, Mn);
    if (r->ls <= ra) r->qry(la, ra, Mx, Mn);
  }
};
smt *xrt;
signed main() {
  int n, q;
  read(n, q);
  for (int i = 1; i <= n; ++i) {
    read(a[i]);
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  m = unique(b + 1, b + n + 1) - b - 1;
  for (int i = 1; i <= n; ++i) {
    a[i] = lower_bound(b + 1, b + m + 1, a[i]) - b - 1;
    at[a[i]].emplace_back(i);
    add(rt[a[i]], 1, n, i);
  }
  xrt = new smt(1, n);
  for (; q; --q) {
    int l, r;
    read(l, r);
    int mx = -inf, mn = inf;
    xrt->qry(l, r, mx, mn);
    if (mn == mx)
      write("0\n\n");
    else {
      int xl = 0, xr = 0;
      fndl(rt[mn], rt[mx], 1, n, xl, l);
      fndr(rt[mn], rt[mx], 1, n, xr, r);
      if (xl && xr) {
        auto it1 = lower_bound(at[mn].begin(), at[mn].end(), xl),
             it2 = lower_bound(at[mx].begin(), at[mx].end(), xl);
        if (it1 != at[mn].end() && *it1 <= xr && it2 != at[mx].end() &&
            *it2 <= xr) {
          write(4, '\n', xl, ' ', mmin(*it1, *it2), ' ', mmax(*it1, *it2), ' ',
                xr, '\n');
          continue;
        }
      }
      xl = 0;
      xr = 0;
      fndl(rt[mn], 0, 1, n, xl, l);
      fndr(rt[mn], 0, 1, n, xr, r);
      if (xl && xr) {
        auto it = lower_bound(at[mn].begin(), at[mn].end(), xl);
        if (it != at[mn].end() && *it <= xr) {
          write(3, '\n', xl, ' ', *it, ' ', xr, '\n');
          continue;
        }
      }
      xl = 0;
      xr = 0;
      fndl(rt[mx], 0, 1, n, xl, l);
      fndr(rt[mx], 0, 1, n, xr, r);
      if (xl && xr) {
        auto it = lower_bound(at[mx].begin(), at[mx].end(), xl);
        if (it != at[mx].end() && *it <= xr) {
          write(3, '\n', xl, ' ', *it, ' ', xr, '\n');
          continue;
        }
      }
      write("0\n\n");
    }
  }
  return 0;
}
