#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int res = 0, f = 1;
  char ch;
  while (ch = getchar(), ch < '0' || ch > '9')
    if (ch == '-') f = -1;
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return res * f;
}
const int N = 3e5 + 5;
char s[N];
int val[N], sum[N], n, q;
vector<int> vec[N * 4];
int main() {
  int T = read();
  while (T--) {
    n = read(), q = read();
    for (int i = 1; i <= 4 * n; ++i) vector<int>().swap(vec[i]);
    scanf("%s", s + 1);
    for (int i = 1; i <= n; ++i) {
      if (s[i] == '+')
        val[i] = 1;
      else
        val[i] = -1;
      if (i & 1) val[i] = -val[i];
      sum[i] = sum[i - 1] + val[i];
      vec[2 * sum[i] - val[i] + 2 * n].push_back(i);
    }
    while (q--) {
      int l = read(), r = read();
      if (sum[r] - sum[l - 1] == 0)
        puts("0");
      else {
        int w = sum[r] + sum[l - 1] + 2 * n;
        if (!vec[w].empty()) {
          int p = lower_bound(vec[w].begin(), vec[w].end(), l) - vec[w].begin();
          if (vec[w][p] > r) {
            puts("2");
            int v = sum[r - 1] + sum[l - 1] + 2 * n;
            p = lower_bound(vec[v].begin(), vec[v].end(), l) - vec[v].begin();
            printf("%d %d\n", vec[v][p], r);
          } else
            puts("1"), printf("%d\n", vec[w][p]);
        } else {
          puts("2");
          int v = sum[r - 1] + sum[l - 1] + 2 * n;
          int p = lower_bound(vec[v].begin(), vec[v].end(), l) - vec[v].begin();
          printf("%d %d\n", vec[v][p], r);
        }
      }
    }
  }
  return 0;
}
