You are given a complete directed graph $K_n$ with $n$ vertices: each pair of vertices $u \neq v$ in $K_n$ have both directed edges $(u, v)$ and $(v, u)$; there are no self-loops.

You should find such a cycle in $K_n$ that visits every directed edge exactly once (allowing for revisiting vertices).

We can write such cycle as a list of $n(n - 1) + 1$ vertices $v_1, v_2, v_3, \dots, v_{n(n - 1) - 1}, v_{n(n - 1)}, v_{n(n - 1) + 1} = v_1$ — a visiting order, where each $(v_i, v_{i + 1})$ occurs exactly once.

Find the lexicographically smallest such cycle. It's not hard to prove that the cycle always exists.

Since the answer can be too large print its $[l, r]$ segment, in other words, $v_l, v_{l + 1}, \dots, v_r$.


-----Input-----

The first line contains the single integer $T$ ($1 \le T \le 100$) — the number of test cases.

Next $T$ lines contain test cases — one per line. The first and only line of each test case contains three integers $n$, $l$ and $r$ ($2 \le n \le 10^5$, $1 \le l \le r \le n(n - 1) + 1$, $r - l + 1 \le 10^5$) — the number of vertices in $K_n$, and segment of the cycle to print.

It's guaranteed that the total sum of $n$ doesn't exceed $10^5$ and the total sum of $r - l + 1$ doesn't exceed $10^5$.


-----Output-----

For each test case print the segment $v_l, v_{l + 1}, \dots, v_r$ of the lexicographically smallest cycle that visits every edge exactly once.


-----Example-----
Input
3
2 1 3
3 3 6
99995 9998900031 9998900031

Output
1 2 1 
1 3 2 3 
1 



-----Note-----

In the second test case, the lexicographically minimum cycle looks like: $1, 2, 1, 3, 2, 3, 1$.

In the third test case, it's quite obvious that the cycle should start and end in vertex $1$.

Difficulty: interview

Starter code:

Solutions:
from collections import *
import sys
try: inp = raw_input
except: inp = input
def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]


def solve():
    n, L, R = nl()
    L -= 1
    R -= 1
    SM = 0
    out = []
    for i in range(1, n):
        no = (n - i)*2
        if no + SM <= L:
            SM += no
            continue
        if SM > R: continue
        ARR = [i if j%2 == 0 else i + j//2 + 1 for j in range(no)]
        start = max(0, L - SM)
        end = R - SM + 1
        out.extend(ARR[start:end])
        SM += no
    if R == SM:
        out.append(1)
    print(' '.join(map(str, out)))





T = ni()
for _ in range(T):
    solve()


t = int(input())
for case_num in range(t):
    n, l, r = list(map(int, input().split(' ')))
    if l == n * (n-1) + 1:
        print(1)
        continue
    total = 0
    unvisited = n - 1
    while total < l:
        total += unvisited * 2
        unvisited -= 1
    unvisited += 1
    total -= unvisited * 2
    current = n - unvisited
    nxt = current + 1
    ans = []
    while total < r:
        total += 1
        now = current if total % 2 == 1 else nxt
        if now == nxt:
            nxt += 1
            if nxt > n:
                current += 1
                nxt = current + 1
                if current == n:
                    current = 1
        if total >= l:
            ans.append(now)
    print(' '.join(map(str, ans)))


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]


for _ in range(val()):
    n,l,r = li()
    orig = r
    l -= 1
    r -= l


    currleft = 0
    curs = n - 1
    while curs and currleft + 2*curs <= l:
        currleft += 2*curs
        curs -= 1
    
    start = n - curs
    ans = []
    head = start
    l -= currleft

    last = head + 1
    half = 0
    while l:
        half = 1
        start = last
        last += 1
        l -= 1
        if not l:break
        half = 0
        start = head
        l -= 1

    if half:
        ans.append(start)
        if last == n + 1:
            head += 1
            last = head + 1
        start = head
        r -= 1

    while r:
        ans.append(start)
        r -= 1
        if not r:break
        start = last
        ans.append(start)
        last += 1
        if last == n + 1:
            head += 1
            last = head + 1
        r -= 1
        start = head
    
    if orig == n*(n-1) + 1:
        ans[-1] = 1

    print(*ans)
        

    

    


import sys
input = sys.stdin.readline

T=int(input())
for tests in range(T):
    n,l,r=list(map(int,input().split()))

    begin=1
    while l>(n-begin)*2+1:
        if begin==n:
            break

        l-=(n-begin)*2
        r-=(n-begin)*2
        begin+=1

    #print(begin,l,r)

    if begin==n:
        ANS=[n,1]
    else:

        ANS=[]
        while len(ANS)<=r:
            if begin==n:
                ANS.append(1)
                break
            
            for j in range(begin+1,n+1):
                ANS.append(begin)
                ANS.append(j)
            begin+=1

            #print(ANS)

    print(*ANS[l-1:r])
    
        


def slv(n,l, r):
    l-=1
    r-=1
    c = 0
    ans = []
    for i in range(1, n):
        nl,nr = c, c + 2*(n-i)-1
        c = nr+1
        if l > nr:
            continue
        for j in range(max(l, nl), min(r, nr)+1):
            if j %2 == 0:
                ans.append(i)
            else:
                ans.append(i + (j-nl+1)//2)
    if r == n*(n-1):
        ans.append(1)
    print(' '.join([str(i) for i in ans]))


t = int(input())
for _ in range(t):
    n,l,r = list(map(int, input().split()))
    slv(n,l,r)