

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;

public class D {
	private static int n;
	private static long l, r;
	private static int[] a;

	public static void main(String[] args) {
		int t = in.nextInt();
		while (t-- > 0) {
			n = ini();
			l = in.nextLong();
			r = in.nextLong();
			ArrayList<Long> list = new ArrayList<>();
			for(int i=1; i<n; i++) {
				list.add(2*1L*(n-i));
			}
			list.add(1L);
			
//			println("H");
			
			
			long[] pre = new long[list.size()];
			for(int i=0; i<pre.length; i++) {
				pre[i] = (i-1>=0?pre[i-1]:0)+list.get(i);
			}
			
//			println(pre[pre.length-1]);
			
			int index1 = 0;
			int index2 = 0;
			long sum = 0;
			while(index1<list.size() && sum<=l) {
//				println(sum);
				if (sum+list.get(index1)>=l) {
					break;
				}
				sum += list.get(index1);
				index1++;
			}
//			
			sum = 0;
			while(index2<list.size() && sum<=r) {
				if (sum+list.get(index2)>=r) {
					break;
				}
				sum += list.get(index2);
				index2++;
			}
//			
			long start1 = (l-(index1-1>=0?pre[index1-1]:0));
			long start2 = (r-(index2-1>=0?pre[index2-1]:0));
//			
////			println("S "+start2);
//			
//			println("L "+list.size());
//			println(index1+", "+index2);
//			
			if (index1==index2) {
				if (index1==list.size()-1) {
					println(1);
					continue;
				}
				int x = index1+1;
				int z = index1+2;
				int count = 0;
				while(true) {
	//				println("XX"+x);
					if (count+1>=start1 && count+1<=start2) {
						print(x);
					}
					if (x==n) break;
					if (x==index1+1) {
						x = z;
						z++;
						if (x==n) {
							print(n);
							break;
						}
					} else {
						x = index1+1;
					}
				}
					
				continue;	
			}
			
			if (index1==list.size()-1) {
				print(1);
				
			} else {
				int x = index1+1;
				int z = index1+2;
				int count = 0;
				while(true) {
	//				println("XX"+x);
					if (count+1>=start1) {
						print(x);
					}
					if (x==n) break;
					if (x==index1+1) {
						x = z;
						z++;
						if (x==n) {
							print(n);
							break;
						}
					} else {
						x = index1+1;
					}
					
					count++;
				}
			}
			
//			
//			println("DONE");
			
			for(int k=index1+1; k<=index2-1; k++) {
				int x = k+1;
				int z = k+2;
				while(x<=n) {
					print(x);
					if (x==n) break;
					if (x==k+1) {
						x = z;
						z++;
					} else {
						x = k+1;
					}
				}
			}
			

			if (index2==list.size()-1) {
				print(1);
			} else {
				int x = index2+1;
				int z = index2+2;
				int count = 0;
				while(true) {
//					if (count>100) break;
//					println("XX"+x);
					if (count+1<=start2) {
						print(x);
					}
					if (x==n) break;
					if (x==index2+1) {
						x = z;
						z++;
						if (x==n) {
							print(n);
							break;
						}
					} else {
						x = index2+1;
					}
					
					count++;
				}
			
			}
			
			println();
			
		}

		out.flush();
		out.close();

	}

	//NONPROBLEM CODE

	private static InputReader in = new InputReader(System.in);
	private static PrintWriter out = new PrintWriter(System.out);

	private static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;

		public InputReader(InputStream st) {
			this.stream = st;
		}

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}

	//INPUT SHORTCUTS

	private static int[] ina(int n) {
		int[] temp = new int[n];
		for (int i = 0; i < n; i++) {
			temp[i] = in.nextInt();
		}
		return temp;
	}

	private static int ini() {
		return in.nextInt();
	}

	//OTHER SHORTCUTS
	public static void sort(int[] a) {
		Arrays.sort(a);
	}

	//PRINT SHORTCUTS

	private static void println(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static void print(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.flush();
	}

	private static void debug(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static HashMap<Integer, ArrayList<Integer>> intree(int n) {

		HashMap<Integer, ArrayList<Integer>> g = new HashMap<>();
		for (int i = 0; i < n; i++) {
			g.put(i, new ArrayList<>());
		}

		for (int i = 0; i < n - 1; i++) {
			int u = ini() - 1;
			int v = ini() - 1;
			g.get(u).add(v);
			g.get(v).add(u);
		}

		return g;
	}
}
