#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, q;
    string s;
    cin >> n >> q >> s;
    vector<int> a(n);
    vector<int> pre(n + 1);
    pre[0] = 0;
    for (int i = 0; i < n; i++) {
      int flag = i % 2 == 0 ? 1 : -1;
      int c = 0;
      if (s[i] == '-') c = -1;
      if (s[i] == '+') c = 1;
      assert(c);
      pre[i + 1] = pre[i] + flag * c;
    }
    vector<vector<int>> vv(4 * n + 10);
    for (int i = 1; i <= n; i++) {
      vv[pre[i] + pre[i - 1] + 2 * n].emplace_back(i);
    }
    auto get = [&](int l, int r) -> int {
      assert((r - l) % 2 == 0);
      return (*lower_bound(vv[pre[r] + pre[l - 1] + 2 * n].begin(),
                           vv[pre[r] + pre[l - 1] + 2 * n].end(), l));
    };
    while (q--) {
      int l, r;
      cin >> l >> r;
      int sum = pre[r] - pre[l - 1];
      if (sum == 0)
        cout << "0\n";
      else {
        if (sum & 1)
          cout << "1\n" << get(l, r) << '\n';
        else
          cout << "2\n" << l << ' ' << get(l + 1, r) << '\n';
      }
    }
  }
  return 0;
}
