#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const int N = 300005;
char s[N];
int pre[N];
vector<int> pooo[N * 4];
vector<int> *b = pooo + 600000;
int main() {
  int _;
  scanf("%d", &_);
  while (_--) {
    int n, q;
    scanf("%d%d%s", &n, &q, s + 1);
    for (int i = 1; i <= n; i++) {
      int x = s[i] == '+' ? 1 : -1;
      if (i % 2 == 0) x = -x;
      pre[i] = pre[i - 1] + x;
      b[pre[i] + pre[i - 1]].push_back(i);
    }
    while (q--) {
      int x, y;
      scanf("%d%d", &x, &y);
      if (pre[y] - pre[x - 1] == 0) {
        puts("0");
        continue;
      }
      int t = pre[y] + pre[x - 1];
      int k = lower_bound(b[t].begin(), b[t].end(), x) - b[t].begin();
      if (k < b[t].size() && b[t][k] <= y) {
        puts("1");
        printf("%d\n", b[t][k]);
        continue;
      }
      puts("2");
      for (int i = x; i <= y; i++) {
        int t = pre[y] - pre[x - 1] + pre[i] + pre[i - 1];
        int k = lower_bound(b[t].begin(), b[t].end(), x) - b[t].begin();
        if (k < b[t].size() && b[t][k] <= y) {
          printf("%d %d\n", i, b[t][k]);
          break;
        }
      }
    }
    for (int i = 1; i <= n; i++) {
      b[pre[i] + pre[i - 1]].clear();
    }
  }
  return 0;
}
