#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
const int mod = 1e9 + 7;
void hey() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, l, r;
    cin >> n >> l >> r;
    long long kol = r - l + 1;
    int f = -1;
    int s = -1;
    for (int i = n - 1; i >= 1; i--) {
      l -= i * 2;
      if (l < 0) {
        l = (i * 2) + l;
        if (l == 0) {
          f = n;
          s = (n - i) + 1;
          cout << i << '\n';
          kol--;
          cout << f << " ";
          f = s;
          s = f + 1;
          int g = kol / 2;
          while (g) {
            g--;
            cout << f << " " << s << " ";
            s++;
            if (s > n) {
              f++;
              s = f + 1;
            }
          }
          f %= n;
          if (f == 0) {
            f = 1;
          }
          if (kol % 2) {
            cout << f << " ";
          }
        } else if (l % 2) {
          f = (n - i);
          l++;
          s = (n - i) + l / 2;
          int g = kol / 2;
          while (g) {
            g--;
            cout << f << " " << s << " ";
            s++;
            if (s > n) {
              f++;
              s = f + 1;
            }
          }
          f %= n;
          if (f == 0) {
            f = 1;
          }
          if (kol % 2) {
            cout << f;
          }
        } else {
          int f = (n - i) + l / 2;
          if (f == n) {
            s = (n - i) + 1;
          } else {
            s = (n - i);
          }
          cout << f << " ";
          kol--;
          int temp = s;
          if (f == n) {
            f = temp;
            s++;
          } else {
            f = temp;
            s = f + 1;
          }
          int g = kol / 2;
          while (g) {
            cout << f << " " << s << " ";
            s++;
            if (s > n) {
              f++;
              s = f + 1;
            }
            g--;
          }
          f %= n;
          if (f == 0) {
            f = 1;
          }
          if (kol % 2) {
            cout << f;
          }
        }
        break;
      } else if (l == 0) {
        f = n;
        s = (n - i) + 1;
        kol--;
        cout << f << " ";
        f = s;
        s = f + 1;
        int g = kol / 2;
        while (g) {
          g--;
          cout << f << " " << s << " ";
          s++;
          if (s > n) {
            f++;
            s = f + 1;
          }
        }
        f %= n;
        if (f == 0) {
          f = 1;
        }
        if (kol % 2) {
          cout << f << " ";
        }
        break;
      }
    }
    if (f == -1) {
      cout << 1;
    }
    cout << '\n';
  }
}
