rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())

def solve(N, L, R):
    L -= 1; R -= 1
    if N == 1:
        return [1][L:R+1]
    if N == 2:
        return [1,2,1][L:R+1]
    if N == 3:
        return [1,2,1,3,2,3,1][L:R+1]

    page = 2*N - 2
    k = 1
    left = 0
    while left + page <= L:
        left += page
        k += 1
        page -= 2
        if page == 0: page = 1

    def write(k):
        for j in xrange(k+1, N+1):
            bns.append(k)
            bns.append(j)
        if k == N:
            bns.append(1)

    bns = []
    while len(bns) < R - left + 1:
        write(k)
        k += 1
    return bns[L-left:R-left+1]
    

for tc in xrange(rri()):
    ans = solve(*rrm())
    print " ".join(map(str, ans))
