#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double log(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, long long *, ...);
int main() {
  long long int t, N, temp1, temp2, i, j, l, r;
  double temp3, temp4;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &N);
    scanf("%lld %lld", &l, &r);
    temp1 = (log(l)) / (log(2));
    temp3 = (double)(log(l)) / (log(2));
    temp2 = (log(r)) / (log(2));
    temp4 = (double)(log(r)) / (log(2));
    if (temp2 == temp4) {
      printf("%lld\n", (1 << r) - 1);
    } else {
      printf("%lld\n", (1 << l) - 1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     12a2 <main+0x172>
lea    0xe91(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x48(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x40(%rbp),%rax
mov    %eax,%edi
call   1050 <log@plt>
movsd  %xmm0,-0x78(%rbp)
mov    $0x2,%edi
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x20(%rbp)
mov    -0x40(%rbp),%rax
mov    %eax,%edi
call   1050 <log@plt>
movsd  %xmm0,-0x70(%rbp)
mov    $0x2,%edi
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    %eax,%edi
call   1050 <log@plt>
movsd  %xmm0,-0x68(%rbp)
mov    $0x2,%edi
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x28(%rbp)
mov    -0x48(%rbp),%rax
mov    %eax,%edi
call   1050 <log@plt>
movsd  %xmm0,-0x60(%rbp)
mov    $0x2,%edi
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm0
ucomisd -0x58(%rbp),%xmm0
jne    1281 <main+0x151>
jp     1281 <main+0x151>
mov    -0x48(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
sub    $0x1,%esi
lea    0xd93(%rip),%rdi
call   1030 <printf@plt>
jmp    129d <main+0x16d>
mov    -0x40(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
sub    $0x1,%esi
lea    0xd72(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xec0(%rip),%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subq   $0x1,0x18(%rsp)
jb     1245 <main+0x115>
lea    0x20(%rsp),%r15
lea    0xe97(%rip),%r12
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r13
lea    0xe90(%rip),%rbp
nopw   0x0(%rax,%rax,1)
lea    0xe7e(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%edi
call   1050 <log@plt>
mov    $0x2,%edi
call   1050 <log@plt>
mov    0x10(%rsp),%edi
call   1050 <log@plt>
mov    $0x2,%edi
call   1050 <log@plt>
mov    0x8(%rsp),%edi
call   1050 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1050 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%r14
mov    0x8(%rsp),%edi
call   1050 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1050 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %r14,%xmm0
ucomisd %xmm0,%xmm1
mov    %r13,%rax
cmovne %rbx,%rax
cmovp  %rbx,%rax
movzbl (%rax),%ecx
mov    $0xffffffff,%esi
shl    %cl,%esi
not    %esi
mov    %rbp,%rdi
call   1030 <printf@plt>
subq   $0x1,0x18(%rsp)
jae    1180 <main+0x50>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [10 x i8] c"%lld %lld\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca double
%11 = alloca double
store i32 0, i32* %1
%12 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
br label %13
13: ; preds = %58, %0
%14 = load i64, i64* %2
%15 = add nsw i64 %14, -1
store i64 %15, i64* %2
%16 = icmp ne i64 %14, 0
br i1 %16, label %17, label %59
17: ; preds = %13
%18 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%19 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %8, i64* %9)
%20 = load i64, i64* %8
%21 = trunc i64 %20 to i32
%22 = call double @log(i32 %21)
%23 = call double @log(i32 2)
%24 = fdiv double %22, %23
%25 = fptosi double %24 to i64
store i64 %25, i64* %4
%26 = load i64, i64* %8
%27 = trunc i64 %26 to i32
%28 = call double @log(i32 %27)
%29 = call double @log(i32 2)
%30 = fdiv double %28, %29
store double %30, double* %10
%31 = load i64, i64* %9
%32 = trunc i64 %31 to i32
%33 = call double @log(i32 %32)
%34 = call double @log(i32 2)
%35 = fdiv double %33, %34
%36 = fptosi double %35 to i64
store i64 %36, i64* %5
%37 = load i64, i64* %9
%38 = trunc i64 %37 to i32
%39 = call double @log(i32 %38)
%40 = call double @log(i32 2)
%41 = fdiv double %39, %40
store double %41, double* %11
%42 = load i64, i64* %5
%43 = sitofp i64 %42 to double
%44 = load double, double* %11
%45 = fcmp oeq double %43, %44
br i1 %45, label %46, label %52
46: ; preds = %17
%47 = load i64, i64* %9
%48 = trunc i64 %47 to i32
%49 = shl i32 1, %48
%50 = sub nsw i32 %49, 1
%51 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %50)
br label %58
52: ; preds = %17
%53 = load i64, i64* %8
%54 = trunc i64 %53 to i32
%55 = shl i32 1, %54
%56 = sub nsw i32 %55, 1
%57 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %52, %46
br label %13
59: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [10 x i8] c"%lld %lld\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %1 to i8*
%6 = bitcast i64* %2 to i8*
%7 = bitcast i64* %3 to i8*
%8 = bitcast i64* %4 to i8*
%9 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%10 = load i64, i64* %1
%11 = add nsw i64 %10, -1
store i64 %11, i64* %1
%12 = icmp eq i64 %10, 0
br i1 %12, label %47, label %13
13: ; preds = %0, %13
%14 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%15 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %3, i64* %4)
%16 = load i64, i64* %3
%17 = trunc i64 %16 to i32
%18 = call double @log(i32 %17)
%19 = call double @log(i32 2)
%20 = load i64, i64* %3
%21 = trunc i64 %20 to i32
%22 = call double @log(i32 %21)
%23 = call double @log(i32 2)
%24 = load i64, i64* %4
%25 = trunc i64 %24 to i32
%26 = call double @log(i32 %25)
%27 = call double @log(i32 2)
%28 = fdiv double %26, %27
%29 = fptosi double %28 to i64
%30 = load i64, i64* %4
%31 = trunc i64 %30 to i32
%32 = call double @log(i32 %31)
%33 = call double @log(i32 2)
%34 = fdiv double %32, %33
%35 = sitofp i64 %29 to double
%36 = fcmp oeq double %34, %35
%37 = load i64, i64* %3
%38 = load i64, i64* %4
%39 = select i1 %36, i64 %38, i64 %37
%40 = trunc i64 %39 to i32
%41 = shl nsw i32 -1, %40
%42 = xor i32 %41, -1
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = load i64, i64* %1
%45 = add nsw i64 %44, -1
store i64 %45, i64* %1
%46 = icmp eq i64 %44, 0
br i1 %46, label %47, label %13
47: ; preds = %13, %0
ret i32 0
}