TnT/CodeNet4Repair huggingface dataset:
Problem:
You are given N integers; the i-th of them is A_i. Find the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
A =[0]*N
for i in range(N):
    A[i] = int(input())
A.sort(reverse=True)

X=0
Y=0
if N % 2 == 0:
    for i in range(N//2-2):
        X = X + 2*A[i] -2*A[-i-1]
    X = X + A[N//2-1] -A[N//2]
    print(X)    

if N % 2 == 1:
        for i in range(N//2-1):
            X = X + 2 * A[i]
            Y = Y - 2 * A[-i-1]
        for i in range (N//2-2):
            X = X - 2 * A[-i-1]
            Y = Y + 2 * A[i]
        X = X - A[N//2] - A[N//2+1]
        Y = Y + A[N//2-1] + A[N//2]
        print(max(X,Y))
    

Fixed, accepted submission:
N = int(input())
A =[0]*N
for i in range(N):
    A[i] = int(input())
A.sort(reverse=True)
X=0
Y=0
if N % 2 == 0:
    for i in range(N//2-1):
        X = X + 2*A[i] -2*A[-i-1]
    X = X + A[N//2-1] -A[N//2]
    print(X)    

if N % 2 == 1:
        for i in range(N//2):
            X = X + 2 * A[i]
            Y = Y - 2 * A[-i-1]
        for i in range (N//2-1):
            X = X - 2 * A[-i-1]
            Y = Y + 2 * A[i]
        X = X - A[N//2] - A[N//2+1]
        Y = Y + A[N//2-1] + A[N//2]
        print(max(X,Y))
Problem:
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
A = list(map(int, input().split()))
x = max(A)
y = 1e9
x2 = x/2
for a in sorted(A):
    if abs(x2 - a) < abs(x2 - y):
        y = a
        print(x, y, abs(x/2 - a))
    else:
        break
print(x, y)


Fixed, accepted submission:
n = int(input())
A = list(map(int, input().split()))
x = max(A)
y = 1e9
x2 = x/2
for a in sorted(A):
    if abs(x2 - a) < abs(x2 - y):
        y = a
    else:
        break
print(x, y)
Problem:
Takahashi is a user of a site that hosts programming contests.   When a user competes in a contest, the _rating_ of the user (not necessarily an integer) changes according to the _performance_ of the user, as follows:    * Let the current rating of the user be a.   * Suppose that the performance of the user in the contest is b.   * Then, the new rating of the user will be the avarage of a and b.  For example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.  Takahashi's current rating is R, and he wants his rating to be exactly G after the next contest.   Find the performance required to achieve it.

Incorrect submission (verdict: Wrong Answer):
##Rating Goal

a = int(input())
b = int(input())
print((a+b)/2)

Fixed, accepted submission:
##Rating Goal

a = int(input())
b = int(input())
print(2*b-a)
Problem:
M-kun is a competitor in AtCoder, whose highest rating is X.   In this site, a competitor is given a _kyu_ (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given:    * From 400 through 599: 8-kyu   * From 600 through 799: 7-kyu   * From 800 through 999: 6-kyu   * From 1000 through 1199: 5-kyu   * From 1200 through 1399: 4-kyu   * From 1400 through 1599: 3-kyu   * From 1600 through 1799: 2-kyu   * From 1800 through 1999: 1-kyu  What kyu does M-kun have?

Incorrect submission (verdict: Wrong Answer):
a=int(input())
print(max(8-(a-400)/200,1))

Fixed, accepted submission:
a=int(input())
print(max(8-(a-400)//200,1))
Problem:
You are given a grid with 2 rows and 3 columns of squares. The color of the square at the i-th row and j-th column is represented by the character C_{ij}.  Write a program that prints `YES` if this grid remains the same when rotated 180 degrees, and prints `NO` otherwise.

Incorrect submission (verdict: Wrong Answer):
print('YNEOS'[input()==input()[::-1]::2])

Fixed, accepted submission:
print('YNEOS'[input()!=input()[::-1]::2])
Problem:
Compute A \times B, truncate its fractional part, and print the result as an integer.

Incorrect submission (verdict: Wrong Answer):
a, b = list(input().split())
a = int(a)
b = float(b) * 100
print(a * b // 100)

Fixed, accepted submission:
import math
a, b = map(str, input().split())
a_ = int(a)
b_ = round(100 * float(b))
 
print((a_ * b_) // 100)
Problem:
We ask you to select some number of positive integers, and calculate the sum of them.  It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.  Your objective is to make the sum congruent to C modulo B. Determine whether this is possible.  If the objective is achievable, print `YES`. Otherwise, print `NO`.

Incorrect submission (verdict: Wrong Answer):
a,b,c=map(int,input().split())

d=[]
i=1
while 1:
  if (a*i)%b==c:
    print("Yes")
    break
  if d.count((a*i)%b):
    print("No")
    break
  else:
    d.append((a*i)%b)
  i=i+1



Fixed, accepted submission:
a,b,c=map(int,input().split())

d=[]
i=1
while 1:
  if (a*i)%b==c:
    print("YES")
    break
  if d.count((a*i)%b):
    print("NO")
    break
  else:
    d.append((a*i)%b)
  i=i+1
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):
def calc_trapezoid_area(top_length, under_length, height):    
    return top_length + under_length * height / 2

if __name__=='__main__':
    top_length, under_length, height = map(int, [input() for i in range(3)])
    print(calc_trapezoid_area(top_length, under_length, height))

Fixed, accepted submission:
def calc_trapezoid_area(top_length, under_length, height):    
    return (top_length + under_length) * height // 2

if __name__=='__main__':
    top_length, under_length, height = map(int, [input() for i in range(3)])
    print(calc_trapezoid_area(top_length, under_length, height))
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
s = input()
print(s[s.index("A"):s.rindex("Z")+1])


Fixed, accepted submission:
s = input()
print(s.rindex("Z") - s.index("A")+1)
Problem:
Snuke has a favorite restaurant.  The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.  So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen. Find x-y.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
print(n*800-n/15*200)

Fixed, accepted submission:
n = int(input())
print(n*800-n//15*200)
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):
A = list(map(int,input().split()))
A.sort()
if A == [5,5,7]:
    print("Yes")
else:
    print("No")

Fixed, accepted submission:
A = list(map(int,input().split()))
A.sort()
if A == [5,5,7]:
    print("YES")
else:
    print("NO")
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()) for i in range(3)]
print((a[0]+a[1])*a[2]/2)

Fixed, accepted submission:
import math
a=[int(input()) for i in range(3)]
print(math.floor((a[0]+a[1])*a[2]/2))
Problem:
You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:    * Wield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.   * Throw one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.  The monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?

Incorrect submission (verdict: Wrong Answer):
import sys

n, h = map(int, input().split())
a = []
b = []

for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

b.sort(reverse=True)
max_a = max(a)

b = [x for x in b if x > max_a]

for i, x in enumerate(b):
    h -= x
    if h <= 0:
        print(i + 1)
        sys.exit()

ans = i + 1 + h // max_a

print(ans)

Fixed, accepted submission:
import sys

n, h = map(int, input().split())

max_a = 0
b = []
for i in range(n):
    x, y = map(int, input().split())
    max_a = max(max_a, x)
    b.append(y)


b = [x for x in b if x > max_a]


b.sort(reverse=True)

i = 0
if len(b) > 0:
    for i, x in enumerate(b):
        i += 1
        h -= x
        if h <= 0:
            print(i)
            sys.exit()


print((h + max_a - 1) // max_a + i)
Problem:
Two children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second. The other child is now at coordinate B, and she can travel the distance of W per second.  He can catch her when his coordinate is the same as hers. Determine whether he can catch her within T seconds (including exactly T seconds later). We assume that both children move optimally.

Incorrect submission (verdict: Wrong Answer):
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
if (B-A)>T*(V-W):
  print('No')
else:
  print('Yes')

Fixed, accepted submission:
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())

if abs(B-A)<=T*(V-W):
  print('YES')
else:
  print('NO')
Problem:
We ask you to select some number of positive integers, and calculate the sum of them.  It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.  Your objective is to make the sum congruent to C modulo B. Determine whether this is possible.  If the objective is achievable, print `YES`. Otherwise, print `NO`.

Incorrect submission (verdict: Wrong Answer):
a,b,c=map(int,input().split())
for i in range(b):
    if a*i%b==c:
        print("YES")
        break
    else:
        print("NO")


Fixed, accepted submission:
a,b,c=map(int,input().split())
for i in range(1,100000):
    if a*i%b==c:
        print("YES")
        exit()
print("NO")
Problem:
There are N rabbits, numbered 1 through N.  The i-th (1≤i≤N) rabbit likes rabbit a_i. Note that no rabbit can like itself, that is, a_i≠i.  For a pair of rabbits i and j (i＜j), we call the pair (i，j) a _friendly pair_ if the following condition is met.    * Rabbit i likes rabbit j and rabbit j likes rabbit i.  Calculate the number of the friendly pairs.

Incorrect submission (verdict: Wrong Answer):

N = int(input()) - 1
a = [int(s) - 1 for s in input().split()]

friends = []

for i in range(N):
    print(i)
    if a[a[i]] == i and ([i, a[i]] not in friends and [a[i], i] not in friends):
        friends.append([i, a[i]])

print(len(friends))

Fixed, accepted submission:

N = int(input()) - 1
a = [int(s) - 1 for s in input().split()]

pairs = 0

for i in range(N):
    if a[i] != 0 and a[a[i]] == i:
        pairs += 1
        a[i] = 0
        a[a[i]] = 0

print(pairs)
Problem:
Write a program which reads three integers, and prints them in ascending order.

Incorrect submission (verdict: Wrong Answer):
nums = [int(e) for e in input().split()]
for i in range(len(nums)):
    for j in range(i):
        if nums[i]<nums[j]:
            a = nums[i]
            nums[i] = nums[j]
            nums[j] = a
print(nums)


Fixed, accepted submission:
nums = [int(e) for e in input().split()]
for i in range(len(nums)):
    for j in range(i):
        if nums[i]<nums[j]:
            a = nums[i]
            nums[i] = nums[j]
            nums[j] = a

nums_2 = " ".join(map(str, nums))
print(nums_2)
Problem:
Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Incorrect submission (verdict: Wrong Answer):
n,m=[int(i) for i in input().split()]

if n>=2*m:
  print(m//2)
else:
  print(n+(m-2*n)//2)

Fixed, accepted submission:
n, m = [int(i) for i in input().split()]

if 2*n >= m:
    print(m // 2)
else:
    print(n + (m - 2 * n) // 4)
Problem:
An _X -layered kagami mochi_ (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.  Lunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?

Incorrect submission (verdict: Wrong Answer):
n=int(input())
d=[]
for i in range(n):
    d.append(int(input()))
ans=set(d)
print(ans)

Fixed, accepted submission:
print(len(set([int(input()) for i in range(int(input()))])))
Problem:
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.  Determine if it is possible that there are exactly X cats among these A + B animals.

Incorrect submission (verdict: Wrong Answer):
a, b, x = map(int, input().split())
if a > x or a + b < x:
  print("No")
else:
  print("Yes")

Fixed, accepted submission:
a, b, x = map(int, input().split())
if a <= x <= a+b:
  print("YES")
else:
  print("NO")
Problem:
Snuke has a favorite restaurant.  The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.  So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen. Find x-y.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
ans = 800 * n - 200 * n // 15
print(ans)

Fixed, accepted submission:
n = int(input())
ans = 800 * n - 200 * (n // 15)
print(ans)
Problem:
A Hitachi string is a concatenation of one or more copies of the string `hi`.  For example, `hi` and `hihi` are Hitachi strings, while `ha` and `hii` are not.  Given a string S, determine whether S is a Hitachi string.

Incorrect submission (verdict: Wrong Answer):
s = str(input())
if len(s)%2 != 0:
  print("No")
  exit()
for i in range(len(s)//2):
  if s[i:i+1] != "hi":
    print("No")
    exit()
print("Yes")
  

Fixed, accepted submission:
s = str(input())
if len(s)%2 != 0:
  print("No")
  exit()
for j in range(len(s)//2):
  if s[2*j] != "h" or s[2*j+1] != "i":
    print("No")
    exit()
print("Yes")
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):
n=int(input())
a,b=n%11,n//11
if a==0:
    print(b*2)
elif a<=6:
    print(b*2+1)
else:
    print(b*2+2)

Fixed, accepted submission:
input()
a=len(set(input().split()))
print(a-1+a%2)
Problem:
Let w be a string consisting of lowercase letters. We will call w _beautiful_ if the following condition is satisfied:    * Each lowercase letter of the English alphabet occurs even number of times in w.  You are given the string w. Determine if w is beautiful.

Incorrect submission (verdict: Wrong Answer):
#B
w = input()
dic = {chr(i+ord('a')): 0 for i in range(0, 26)}
for c in w:
    dic[c] += 1
result = 'NO'
for i in range(26):
    if dic[chr(i+ord('a'))] % 2 != 0: break
else: result = 'YES'
print(result)

Fixed, accepted submission:
#B
w = input()
dic = {chr(i+ord('a')): 0 for i in range(0, 26)}
for c in w:
    dic[c] += 1
#print(dic) #
result = 'No'
for i in range(26):
    if dic[chr(i+ord('a'))] % 2 != 0: break
else: result = 'Yes'
print(result)
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())
s = [str(input()) for _ in range(n)]

dic = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for i in s:
    if i == 'AC':
        dic['AC'] += 1
    elif i == 'WA':
        dic['WA'] += 1
    elif i == 'TLE':
        dic['TLE'] += 1
    else:
        dic['RE'] += 1

for i in dic:
    # print(i)
    print("{0} × {1}".format(i, dic[i]))

Fixed, accepted submission:
n = int(input())
s = [str(input()) for _ in range(n)]

dic = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for i in s:
    if i == 'AC':
        dic['AC'] += 1
    elif i == 'WA':
        dic['WA'] += 1
    elif i == 'TLE':
        dic['TLE'] += 1
    else:
        dic['RE'] += 1

for i in dic:
    # print(i)
    print("{0} x {1}".format(i, dic[i]))
Problem:
Let w be a string consisting of lowercase letters. We will call w _beautiful_ if the following condition is satisfied:    * Each lowercase letter of the English alphabet occurs even number of times in w.  You are given the string w. Determine if w is beautiful.

Incorrect submission (verdict: Wrong Answer):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

w = input()
import collections
c = collections.Counter(w)
print(c)
for k, v in c.items():
    if v % 2 != 0:
        print('No')
        quit()
print('Yes')


Fixed, accepted submission:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

w = input()
import collections
c = collections.Counter(w)
for k, v in c.items():
    if v % 2 != 0:
        print('No')
        quit()
print('Yes')
Problem:
You are given three words s_1, s_2 and s_3, each composed of lowercase English letters, with spaces in between. Print the acronym formed from the uppercased initial letters of the words.

Incorrect submission (verdict: Wrong Answer):
s1,s2,s3 = input().split()

s1 = s1[0:1]
s2 = s2[0:1]
s3 = s3[0:1]
print(s1 + s2 + s3)

Fixed, accepted submission:
s1,s2,s3 = input().split()

s1 = str(s1[0:1].upper())
s2 = str(s2[0:1].upper())
s3 = str(s3[0:1].upper())
print(s1 + s2 + s3)
Problem:
In the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.  Write a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.

Incorrect submission (verdict: Wrong Answer):
x = input().rsplit()
for i in range(len(x) - 1):
    a = i + 1
    print("Case "+ str(a) + ": " + str(x[i]))


Fixed, accepted submission:
nyuryoku = []

try:
    while True:
        s = input()
        if s == 0:
            break
        nyuryoku.append(s)

except EOFError:
    pass

for i in range(len(nyuryoku) - 1):
    print('Case ' + str(i + 1) + ": " + str(nyuryoku[i]))
Problem:
Two children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second. The other child is now at coordinate B, and she can travel the distance of W per second.  He can catch her when his coordinate is the same as hers. Determine whether he can catch her within T seconds (including exactly T seconds later). We assume that both children move optimally.

Incorrect submission (verdict: Wrong Answer):
i = list(map(int, input().split()))
j = list(map(int, input().split()))
t = int(input())
ans = "No"
if i[0] > j[0]: 
  i[1] = i[0] - t * i[1]
  j[1] = j[0] - t * j[1]
  if i[1] <= j[1]:
    ans = "Yes"
elif i[0] < j[0]: 
  i[1] = i[0] + t * i[1]
  j[1] = j[0] + t * j[1]
  if i[1] >= j[1]:
    ans = "Yes"
else:
    ans = "Yes"

print(ans)

Fixed, accepted submission:
i = list(map(int, input().split()))
j = list(map(int, input().split()))
t = int(input())
ans = "NO"
if i[0] > j[0]: 
  i[1] = i[0] - t * i[1]
  j[1] = j[0] - t * j[1]
  if i[1] <= j[1]:
    ans = "YES"
elif i[0] < j[0]: 
  i[1] = i[0] + t * i[1]
  j[1] = j[0] + t * j[1]
  if i[1] >= j[1]:
    ans = "YES"
else:
    ans = "YES"

print(ans)
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

flag = True
count = 0
while(flag):
  for i in range(N):
    if A[i]%2:
      flag = False
      break
    else:
      count += 1
print(count)
  

Fixed, accepted submission:
N = int(input())
A = list(map(int,input().split()))
 
flag = True
count = 0
while(flag):
  for i in range(N):
    if A[i]%2:
      flag = False
      break
    else:
      A[i] /= 2
  if flag:
    count += 1
print(count)
Problem:
Snuke is giving cookies to his three goats.  He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).  Your task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.

Incorrect submission (verdict: Wrong Answer):
A, B = map(int, input().split())

print(A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0)


Fixed, accepted submission:
A, B = map(int, input().split())

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print('Possible')
else:
    print('Impossible')