import java.util.*;
import java.io.*;

public class D
{
    static IO io = new IO();
    public static void main(String[] args)
    {
		int T = io.getInt();
		while(T-->0){
			long n = io.getInt();
			long l = io.getLong()-1;
			long r = io.getLong()-1;
			long pos = 0, posi = 0;
			long[] len = new long[(int)n];
			for(long i=0; i<n; i++){ //len is the length os seq up to init with i
				len[(int)i] = 2*n*i - i*(i+1);
				if(len[(int)i] < l){
					pos = len[(int)i];
					posi = i;
				}
			}
			
			System.out.println(pos+" "+posi);
			
			long fi = posi+1, se = posi+2, par = 0;
			long out = 0;
			while(pos <= r){
				if(par%2 == 0){
					out = fi;
				}
				else{
					out = se;
					se++;
					if(se == n+1){
						fi++;
						se = fi+1;
					}
					if(fi == n){
						fi = 1;
					}
				}
				if(pos >= l){
					io.print(out+" ");
				}
				
				par = (par+1)%2;
				pos++;
			}
			io.println();
		}
		
		
        io.close();
    }
}



class IO extends PrintWriter {
	public IO() {
        super(new BufferedOutputStream(System.out));
        r = new BufferedReader(new InputStreamReader(System.in));
    }

    public IO(String fileName) {
        super(new BufferedOutputStream(System.out));
        try{
            r = new BufferedReader(new FileReader(fileName));
        } catch (FileNotFoundException e) {
            this.println("File Not Found");
        }
    }

    public boolean hasMoreTokens() {
        return peekToken() != null;
    }

    public int getInt() {
        return Integer.parseInt(nextToken());
    }

    public double getDouble() {
        return Double.parseDouble(nextToken());
    }

    public long getLong() {
        return Long.parseLong(nextToken());
    }

    public String getWord() {
        return nextToken();
    }

	public String getLine(){
        try{
            st = null;
            return r.readLine();
        }
        catch(IOException ex){}
        return null;
    }
	

    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
        if (token == null)
            try {
                while (st == null || !st.hasMoreTokens()) {
                    line = r.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
                token = st.nextToken();
            } catch (IOException e) { }
        return token;
    }

    private String nextToken() {
        String ans = peekToken();
        token = null;
        return ans;
    }
}
