TnT/CodeNet4Repair huggingface dataset:
Problem:
Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the `0` key, the `1` key and the backspace key.  To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:    * The `0` key: a letter `0` will be inserted to the right of the string.   * The `1` key: a letter `1` will be inserted to the right of the string.   * The backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.  Sig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter `0` stands for the `0` key, the letter `1` stands for the `1` key and the letter `B` stands for the backspace key. What string is displayed in the editor now?

Incorrect submission (verdict: Wrong Answer):
li = list(input())
string = ''
for item in li:
        if item == '0':
                string += '0'
        elif item == '1':
                string += '1'
        else:
                string = string[:0]

print(string)


Fixed, accepted submission:
s = input()
ans = ''

for i in s:
    if i == '1':
        ans += '1'
    if i == '0':
        ans += '0'
    if i == 'B':
        if len(ans)>0:
            ans = ans[:-1]

print(ans)
Problem:
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written.  He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of remaining cards. Here, N is odd, which guarantees that at least one card can be kept.  Operation: Take out three arbitrary cards from the deck. Among those three cards, eat two: one with the largest value, and another with the smallest value. Then, return the remaining one card to the deck.

Incorrect submission (verdict: Wrong Answer):
import collections
from operator import itemgetter

n = int(input())
a = sorted(list(map(int, input().split())))
ac = collections.Counter(a).most_common()
ac = sorted(ac, key=itemgetter(0))
nokori = 0
for i in ac:
    if i[1] > 3:
        a = a[:nokori] + a[i[1] - 1 + nokori:]
        nokori += 1
    else:
        use = i[1]
        a = a[:nokori] + a[use - 1 + nokori:]
        nokori += 1
print(len(a))

Fixed, accepted submission:
n = int(input())
a = list(map(int, input().split()))
b = len(set(a))
print(b - 1 + b % 2)
Problem:
Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Wrong Answer):
s=input()
a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])

for i in range(-1,2,2):
    for j in range(-1,2,2):
        for k in range(-1,2,2):
            if i ==-1:
                a_b='-'
            else:
                a_b='+'
            if j ==-1:
                b_c='-'
            else:
                b_c='+'
            if k==-1:
                c_d='-'
            else:
                c_d='+'
            t=a+i*b+j*c+k*d
            if t==7:
                print(str(a)+a_b+str(b)+b_c+str(c)+c_d+str(d)+'==7')
            break


Fixed, accepted submission:
s=input()
op_cnt=len(s)-1


for i in range(2**op_cnt):
    t=int(s[0])
    op=['-']*op_cnt
    for j in range(op_cnt):
        ans=''
        if (i>>j &1):
            op[op_cnt-1-j]='+'
        
    for k in range(op_cnt):
            if op[k]=='-':
                t-=int(s[k+1])
            else:
                t+=int(s[k+1])
    if t==7:
            for l in range(op_cnt):
                ans+=s[l]+op[l]
            ans+=s[op_cnt]
            print(ans+'=7')
            break
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
n = int(input())

ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
    s = str(input())
    if s == 'AC':
        ac += 1
    if s == 'WA':
        wa += 1
    if s == 'TLE':
        tle += 1
    if s == 'RE':
        re += 1

print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',ac)
        

Fixed, accepted submission:
n = int(input())

ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
    s = str(input())
    if s == 'AC':
        ac += 1
    if s == 'WA':
        wa += 1
    if s == 'TLE':
        tle += 1
    if s == 'RE':
        re += 1

print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',re)
Problem:
E869120 has A 1-yen coins and infinitely many 500-yen coins.   Determine if he can pay exactly N yen using only these coins.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
A = int(input())
if N % 500 <= A:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print('No')
Problem:
Write a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.     

Incorrect submission (verdict: Wrong Answer):
w, h, x, y, r = map(int, input().split())

if x + r <= w and x - r <= 0 and y + r >= h and y - r <= 0:
	print("Yes")
else:
	print("No")

Fixed, accepted submission:
w, h, x, y, r = map(int, input().split())

if x + r <= w and x - r >= 0 and y + r <= h and y - r >= 0:
	print("Yes")
else:
	print("No")
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
nums = list(map(int,input().split()))

for i in [5,7,5]:
    if i in nums:
        nums.remove(i)
    else:
        print("No")
        exit()

if len(nums) == 0:
    print("Yes")
else:
    print("No")

Fixed, accepted submission:



nums = list(map(int,input().split()))

for i in [5,7,5]:
    if i in nums:
        nums.remove(i)
    else:
        print("NO")
        exit()

if len(nums) == 0:
    print("YES")
else:
    print("NO")
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Wrong Answer):
def main():
  x = int(input())
  val = 100
  year=1
  while True:
    val = val * 1.01
    print(x,val)
    if x <= val:
      break
    year += 1

  print(year)

if __name__ == '__main__':
  main()


Fixed, accepted submission:
def main():
  x = int(input())
  val = 100
  year=1
  while True:
    val = int(val * 1.01)
    if x <= val:
      break
    year += 1

  print(year)

if __name__ == '__main__':
  main()
Problem:
Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Wrong Answer):
num = list(input())
print(num)
ans = 7
for i in range(2 ** len(num)):
    total = 0
    ans_num = []
    ans_op = []
    for j in range(len(num)):
        if((i >> j) & 1):
            ans_num.append(num[j])
            if(j >= 1):
                ans_op.append('+')
            total += int(num[j])
        else:
            ans_num.append(num[j])
            if (j >= 1):
                ans_op.append('-')
            total -= int(num[j])
    print(total)
    print(ans_op)
    if(total == ans):
        print(ans_num[0]+ans_op[0]+ans_num[1]+ans_op[1]+ans_num[2]+ans_op[2]+ans_num[3]+'=7')
        break

Fixed, accepted submission:
num = list(input())
ans = 7
for i in range(2 ** len(num)):
    total = 0
    ans_num = []
    ans_op = []
    for j in range(len(num)):
        if((i >> j) & 1):
            ans_num.append(num[j])
            if(j >= 1):
                ans_op.append('+')
            total += int(num[j])
        else:
            ans_num.append(num[j])
            if (j >= 1):
                ans_op.append('-')
            total -= int(num[j])
    if(total == ans):
        print(ans_num[0]+ans_op[0]+ans_num[1]+ans_op[1]+ans_num[2]+ans_op[2]+ans_num[3]+'=7')
        break
Problem:
There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle.  Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying to minimize S_{max} \- S_{min}, where S_{max} is the area (the number of blocks contained) of the largest piece, and S_{min} is the area of the smallest piece. Find the minimum possible value of S_{max} - S_{min}.

Incorrect submission (verdict: Wrong Answer):
H, W=map(int, input().split())
m=float("inf")
for i in range(1,H-1):
    S1=i*W
    if (H-1)%2==0:
        S2=W*((H-1)//2)
    else:
        S2=(H-i)*(W//2)
    S3=H*W-S1-S2
    if m>max(S1, S2, S3)-min(S1, S2, S3):
        m=max(S1, S2, S3)-min(S1, S2, S3)
        print(S1,S2,S3)
print(m)


Fixed, accepted submission:
H, W=map(int, input().split())
m=float("inf")
for i in range(1,H):
    S1=i*W
    S2=W*((H-i)//2)
    S3=H*W-S1-S2
    if m>max(S1, S2, S3)-min(S1, S2, S3):
        m=max(S1, S2, S3)-min(S1, S2, S3)

    S2=(H-i)*(W//2)
    S3=H*W-S1-S2
    if m>max(S1, S2, S3)-min(S1, S2, S3):
        m=max(S1, S2, S3)-min(S1, S2, S3)
H,W=W,H
for i in range(1,H):
    S1=i*W
    S2=W*((H-i)//2)
    S3=H*W-S1-S2
    if m>max(S1, S2, S3)-min(S1, S2, S3):
        m=max(S1, S2, S3)-min(S1, S2, S3)

    S2=(H-i)*(W//2)
    S3=H*W-S1-S2
    if m>max(S1, S2, S3)-min(S1, S2, S3):
        m=max(S1, S2, S3)-min(S1, S2, S3)
print(m)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
money=int(input('N'))
i=0
while i<=money:
    if i*1000>=money:
        break
    else:
        i+=1
print(i*1000-money)


Fixed, accepted submission:
money=int(input())
i=0
while i<=money:
    if i*1000>=money:
        break
    else:
        i+=1
print(i*1000-money)
Problem:
You went shopping to buy cakes and donuts with X yen (the currency of Japan).  First, you bought one cake for A yen at a cake shop. Then, you bought as many donuts as possible for B yen each, at a donut shop.  How much do you have left after shopping?

Incorrect submission (verdict: Wrong Answer):
X = int(input())
A = int(input())
B = int(input())
X =- A
print(X % B)

Fixed, accepted submission:
X = int(input())
A = int(input())
B = int(input())
X -= A
print(X%B)
Problem:
Snuke loves working out. He is now exercising N times.  Before he starts exercising, his _power_ is 1. After he exercises for the i-th time, his power gets multiplied by i.  Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7.

Incorrect submission (verdict: Wrong Answer):
import math
N = int(input())
print((math.factorial(N)) % 10 ** 9 + 7)


Fixed, accepted submission:
import math
N = int(input())
print((math.factorial(N)) % (10 ** 9 + 7))
Problem:
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up.  We will perform the following operation once for each square contains a card:    * For each of the following nine squares, flip the card in it if it exists: the target square itself and the eight squares that shares a corner or a side with the target square.  It can be proved that, whether each card faces up or down after all the operations does not depend on the order the operations are performed. Find the number of cards that face down after all the operations.

Incorrect submission (verdict: Wrong Answer):
N, M = (int(i) for i in input().split())

tiles = [[True for i in range(M + 2)] for j in range(N + 2)]
print(tiles)
for i in range(1, N + 1):
    for j in range(1, M + 1):
        tiles[i - 1][j - 1] = not (tiles[i - 1][j - 1])
        tiles[i - 1][j] = not (tiles[i - 1][j])
        tiles[i - 1][j + 1] = not (tiles[i - 1][j + 1])
        tiles[i][j - 1] = not (tiles[i][j - 1])
        tiles[i][j] = not (tiles[i][j])
        tiles[i][j + 1] = not (tiles[i][j + 1])
        tiles[i + 1][j - 1] = not (tiles[i + 1][j - 1])
        tiles[i + 1][j] = not (tiles[i + 1][j])
        tiles[i + 1][j + 1] = not (tiles[i + 1][j + 1])

count = 0

for i in range(1, N + 1):
    for j in range(1, M + 1):
        print(tiles[i][j])
        if not tiles[i][j]:
            count = count + 1
print(count)

Fixed, accepted submission:
N, M = (int(i) for i in input().split())

if N == 1 and M == 1:
    print(1)

elif N == 2 or M == 2:
    print(0)

elif N == 1 or M == 1:
    if N == 1:
        print(M - 2)
    else:
        print(N - 2)

else:
    print((N - 2) * (M - 2))
Problem:
Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:    * 1 \leq x,y,z   * x^2 + y^2 + z^2 + xy + yz + zx = n  Given an integer N, find each of f(1),f(2),f(3),\ldots,f(N).

Incorrect submission (verdict: Wrong Answer):
import math

N = int(input())

def xyzTriplets(N):
    store = {}
    upTo = math.sqrt(N)
    for x in range(1, int(upTo) + 1):
        for y in range(1, int(upTo) + 1):
            for z in range(1, int(upTo) + 1):
                res = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if (res not in store):
                    store[res] = 1
                else:
                    store[res] += 1
    for i in range(N):
        if (i in store):
            print(store[i])
        else:
            print(0)



xyzTriplets(N)


Fixed, accepted submission:
import math

N = int(input())

def xyzTriplets(N):
    store = {}
    upTo = math.sqrt(N)
    for x in range(1, int(upTo) + 1):
        for y in range(1, int(upTo) + 1):
            for z in range(1, int(upTo) + 1):
                res = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if (res not in store):
                    store[res] = 1
                else:
                    store[res] += 1
    for i in range(1, N+1):
        if (i in store):
            print(store[i])
        else:
            print(0)



xyzTriplets(N)
Problem:
You are given a positive integer X. Find the largest _perfect power_ that is at most X. Here, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.

Incorrect submission (verdict: Wrong Answer):
X = int(input())

max_num = 1
for b in range(2, 32):
    num = 1
    for p in range(1, 11):
        num *= b
        if num <= X and num >= max_num:
            max_num = num

print(max_num)

Fixed, accepted submission:
X = int(input())

max_num = 1
for b in range(2, 32):
    num = b
    for p in range(2, 11):
        num *= b
        if num <= X and num >= max_num:
            max_num = num

print(max_num)
Problem:
In Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands. For convenience, we will call them Island 1, Island 2, ..., Island N.  There are M kinds of regular boat services between these islands. Each service connects two islands. The i-th service connects Island a_i and Island b_i.  Cat Snuke is on Island 1 now, and wants to go to Island N. However, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.  Help him.

Incorrect submission (verdict: Wrong Answer):
import sys

N, M = map(int, input().split())
li = [list(map(int, input().split())) for n in range(M)]

a = []
b = []

for i in li:
  if i[1] == N:
    b.append(i[0])

  if i[0] == N:
    a.append(i[1])
    
if len(a) == 0 or len(b) == 0:
  print("IMPOSSIBLE")
  sys.exit()
    
    
for i in a:
  if i in b:
    print("IMPOSSIBLE")
    sys.exit()
    
print("POSSIBLE")

Fixed, accepted submission:
import sys
from collections import defaultdict
d = defaultdict(int)

N, M = map(int, input().split())
li = [list(map(int, input().split())) for n in range(M)]

for i in li:
  if i[1] == N:
    d[i[0]] += 1

for i in li:
  if i[0] == 1 and d[i[1]] != 0:
    print("POSSIBLE")
    sys.exit()
    
print("IMPOSSIBLE")
Problem:
You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`.

Incorrect submission (verdict: Wrong Answer):
S = input()
a_list = list(S)
a_ct = 0
b_ct = 0
c_ct = 0

for i in range(0,3):
    if a_list[i] == 'a':
        a_ct = a_ct + 1

for i in range(0,3):
    if a_list[i] == 'b':
        b_ct = b_ct + 1

for i in range(0,3):
    if a_list[i] == 'c':
        c_ct = c_ct + 1

Fixed, accepted submission:
S = input()
a_list = list(S)
a_ct = 0
b_ct = 0
c_ct = 0

for i in range(0,3):
    if a_list[i] == 'a':
        a_ct = a_ct + 1

for i in range(0,3):
    if a_list[i] == 'b':
        b_ct = b_ct + 1

for i in range(0,3):
    if a_list[i] == 'c':
        c_ct = c_ct + 1

if a_ct == 1 and b_ct == 1 and c_ct == 1:
    print('Yes')
else:
    print('No')
Problem:
There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

Incorrect submission (verdict: Wrong Answer):
n=int(input())

m=n-(n-1)
print((n/2)*(n+m))

Fixed, accepted submission:
n=int(input())

m=n-(n-1)
print(int((n/2)*(n+m)))
Problem:
Takahashi loves numbers divisible by 2.  You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.  Here, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.  For example,    * 6 can be divided by 2 once: 6 -> 3.   * 8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.   * 3 can be divided by 2 zero times.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
C = [2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if C[i] < N:
    continue
  else:
    print(C[i-1])

Fixed, accepted submission:
N = int(input())
C = [1, 2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if N == C[i]:
    print(N)
    break
  elif C[i] < N and N < 64:
    continue
  elif N >= 64:
    print(64)
    break
  else:
    print(C[i-1])
    break
Problem:
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.    An example of a trapezoid  Find the area of this trapezoid.

Incorrect submission (verdict: Wrong Answer):
a = int(input())
b = int(input())
h = int(input())
print(((a+b)*h)/2)

Fixed, accepted submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))
Problem:
For a string S consisting of the uppercase English letters `P` and `D`, let the _doctoral and postdoctoral quotient_ of S be the total number of occurrences of `D` and `PD` in S as contiguous substrings. For example, if S = `PPDDP`, it contains two occurrences of `D` and one occurrence of `PD` as contiguous substrings, so the doctoral and postdoctoral quotient of S is 3.  We have a string T consisting of `P`, `D`, and `?`.  Among the strings that can be obtained by replacing each `?` in T with `P` or `D`, find one with the maximum possible doctoral and postdoctoral quotient.

Incorrect submission (verdict: Wrong Answer):
t = input('')
a = ''
n = ''
for i in range(len(t)):
    if t[i] == 'P':
        n = 'D'
        a += t[i]
    if t[i] == 'D':
        n = 'D'
        a += t[i]
    if t[i] == '?':
        a+=n

print(a)
# DDDDDD -> 6
# PDPDPD -> 6
# PDPDPDP -> 3 + 3
# PDDDDDP -> 1 + 5


Fixed, accepted submission:
t = input('')

tlist = list(t)
for i in range(len(tlist)):
    if tlist[i] == '?':
        if i==0:
            tlist[i] = 'D'
        elif i==len(tlist)-1:
            tlist[i] = 'D'
        else:
            if tlist[i-1] == 'P':
                if tlist[i+1] == 'P':
                    tlist[i] = 'D'
                elif tlist[i+1] == 'D':
                    tlist[i] = 'D'
                elif tlist[i+1] == '?':
                    tlist[i] = 'D'
            else:
                
                if tlist[i+1] == 'P':
                    tlist[i] = 'D'
                elif tlist[i+1] == 'D':
                    tlist[i] = 'P'
                elif tlist[i+1] == '?':
                    tlist[i] = 'P'

print("".join(tlist))
Problem:
In programming languages like C/C++, a goto statement provides an unconditional jump from the "goto" to a labeled statement. For example, a statement "goto CHECK_NUM;" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.  Note that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.  Write a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.                 void call(int n){   int i = 1;  CHECK_NUM:   int x = i;   if ( x % 3 == 0 ){     cout << " " << i;     goto END_CHECK_NUM;   }  INCLUDE3:   if ( x % 10 == 3 ){     cout << " " << i;     goto END_CHECK_NUM;   }   x /= 10;   if ( x ) goto INCLUDE3;  END_CHECK_NUM:   if ( ++i <= n ) goto CHECK_NUM;    cout << endl; }

Incorrect submission (verdict: Wrong Answer):
n=input()
s=''
for i in range(int(n)+1):
    s += (str(i) + ' ') if i%3==0 or '3' in str(i) else ''
print(s)

Fixed, accepted submission:
n=input()
s=''
for i in range(1,int(n)+1):
    s += (' '+str(i)) if i%3==0 or '3' in str(i) else ''
print(s)
Problem:
Snuke lives at position x on a number line. On this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.  Snuke decided to get food delivery from the closer of stores A and B. Find out which store is closer to Snuke's residence.  Here, the distance between two points s and t on a number line is represented by |s-t|.

Incorrect submission (verdict: Wrong Answer):
A = list(map(int, input().split()))
print(min(abs(A[0]-A[1]), abs(A[0]-A[2])))

Fixed, accepted submission:
A = list(map(int, input().split()))
print('A' if abs(A[0]-A[1]) <= abs(A[0]-A[2]) else 'B')