import java.io.*;
import java.util.ArrayList;
import java.util.Random;
import java.util.StringTokenizer;

public class D {
    //Solution by Sathvik Kuthuru
    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = scan.nextInt();
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            long n = scan.nextInt();
            if(n == 2) {
                int[] a = {1, 2, 1};
                int l = scan.nextInt(), r = scan.nextInt();
                for(int i = l - 1; i < r; i++) out.print(a[i] + " ");
                out.println();
                return;
            }
            long l = scan.nextLong(), r = scan.nextLong();
            long soFar = 0;
            long start = -1;
            for(int i = 1; i < n; i++) {
                long curr = (n - i) * 2;
                if(i > 1) curr--;
                soFar += curr;
                if(soFar >= l) {
                    start = i;
                    break;
                }

            }
            if(start == -1) {
                long here = 3 + l - soFar;
                if(here >= n) here = 1;
                int steps = 0;
                long need = r - l + 1;
                while(steps < need) {
                    steps++;
                    out.print(here);
                    out.print(" ");
                    here++;
                    if(here > n) here = 1;
                }
            }
            else {
                soFar -= start == 1 ? (n - start) * 2 : (n - start) * 2 - 1;
                int step = 0;
                while(soFar < l) {
                    step++;
                    soFar++;
                }
                int currStep = step;
                step = 0;
                long need = r - l + 1;
                while(step < need) {
                    step++;
                    if(currStep % 2 == 1) out.print(start == 1 ? 1 : 2 + currStep / 2);
                    else out.print(start == 1 ? 1 + currStep / 2 : n - start + 2);
                    out.print(" ");
                    currStep++;
                    long now = start == 1 ? (n - start) * 2 : (n - start) * 2 - 1;
                    if(currStep > now) {
                        start++;
                        currStep = 1;
                        if(start >= n) break;
                    }
                }
                int here = 3;
                while(step < need) {
                    step++;
                    out.print(here);
                    out.print(" ");
                    here++;
                    if(here > n) here = 1;
                }
            }
            out.println();
        }
    }

    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}