#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 */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int n, a, b, ca, cb, i, u;
  scanf("%d %d %d\n", &n, &a, &b);
  for (i = 1; i <= n; ++i) {
    scanf("%c", &u);
    if (i == a)
      ca = u;
    if (i == b)
      cb = u;
  }
  printf("%d\n", ca != cb);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a5 <main+0x85>
lea    0xea7(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1180 <main+0x60>
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1192 <main+0x72>
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1197 <main+0x77>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1150 <main+0x30>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
mov    %rsp,%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    118a <main+0x6a>
lea    0xeb6(%rip),%r14
lea    0x4(%rsp),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    0xc(%rsp),%ebx
mov    0x4(%rsp),%eax
cmove  %eax,%ebp
cmp    0x8(%rsp),%ebx
cmove  %eax,%r12d
cmp    (%rsp),%ebx
jl     1160 <main+0x40>
jmp    118a <main+0x6a>
xor    %esi,%esi
cmp    %r12d,%ebp
setne  %sil
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
store i32 1, i32* %7
br label %10
10: ; preds = %28, %0
%11 = load i32, i32* %7
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%16 = load i32, i32* %7
%17 = load i32, i32* %3
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %8
store i32 %20, i32* %5
br label %21
21: ; preds = %19, %14
%22 = load i32, i32* %7
%23 = load i32, i32* %4
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* %8
store i32 %26, i32* %6
br label %27
27: ; preds = %25, %21
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %10
31: ; preds = %10
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = icmp ne i32 %32, %33
%35 = zext i1 %34 to i32
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 1
br i1 %11, label %27, label %12
12: ; preds = %0, %12
%13 = phi i32 [ %24, %12 ], [ 1, %0 ]
%14 = phi i32 [ %23, %12 ], [ undef, %0 ]
%15 = phi i32 [ %20, %12 ], [ undef, %0 ]
%16 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %2
%18 = icmp eq i32 %13, %17
%19 = load i32, i32* %4
%20 = select i1 %18, i32 %19, i32 %15
%21 = load i32, i32* %3
%22 = icmp eq i32 %13, %21
%23 = select i1 %22, i32 %19, i32 %14
%24 = add nuw nsw i32 %13, 1
%25 = load i32, i32* %1
%26 = icmp slt i32 %13, %25
br i1 %26, label %12, label %27
27: ; preds = %12, %0
%28 = phi i32 [ undef, %0 ], [ %20, %12 ]
%29 = phi i32 [ undef, %0 ], [ %23, %12 ]
%30 = icmp ne i32 %28, %29
%31 = zext i1 %30 to i32
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %31)
ret i32 0
}