TnT/CodeNet4Repair huggingface dataset:
Problem:
A と B の 2 人のプレーヤーが， 0 から 9 までの数字が書かれたカードを使ってゲームを行う．最初に， 2 人は与えられた n 枚ずつのカードを，裏向きにして横一列に並べる．その後， 2 人は各自の左から 1 枚ずつカードを表向きにしていき，書かれた数字が大きい方のカードの持ち主が，その 2 枚のカードを取る．このとき，その 2 枚のカードに書かれた数字の合計が，カードを取ったプレーヤーの得点となるものとする．ただし，開いた 2 枚のカードに同じ数字が書かれているときには，引き分けとし，各プレーヤーが自分のカードを 1 枚ずつ取るものとする．  例えば， A，B の持ち札が，以下の入力例 1 から 3 のように並べられている場合を考えよう．ただし，入力ファイルは n + 1 行からなり， 1 行目には各プレーヤのカード枚数 n が書かれており， i + 1 行目（i = 1，2，... ，n）には A の左から i 枚目のカードの数字と B の左から i 枚目の カードの数字が，空白を区切り文字としてこの順で書かれている．すなわち，入力ファイルの 2 行目以降は，左側の列が A のカードの並びを，右側の列が B のカードの並びを，それぞれ表している．このとき，ゲーム終了後の A と B の得点は，それぞれ，対応する出力例に示したものとなる．  入力ファイルに対応するゲームが終了したときの A の得点と B の得点を，この順に空白を区切り文字として 1 行に出力するプログラムを作成しなさい．ただし， n ≤ 10000 とする．  入力例１ | 入力例２ | 入力例３   ---|---|---   3| 3| 3   9 1| 9 1| 9 1   5 4| 5 4| 5 5   0 8| 1 0| 1 8   出力例１ | 出力例２ | 出力例３   19 8| 20 0| 15 14

Incorrect submission (verdict: Wrong Answer):
n = int(input())
A = 0
B = 0
for i in range(n):
    a,b = map(int,input().split())
    if a > b:A += a + b
    elif a < b:B += a + b
    else:
        A+=a
        B+=b
print(A,B)

Fixed, accepted submission:
while True:
    n = int(input())
    if n == 0:break
    A = B = 0
    for i in range(n):
        a,b = map(int,input().split())
        if a > b:A += a + b
        elif a < b:B += a + b
        else:
            A+=a
            B+=b
    print(A,B)
Problem:
You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total?  Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Incorrect submission (verdict: Wrong Answer):


a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for i in range(a):
    for j in range(b):
        for k in range(c):
            if 500 * i + 100 * j + 50 * k == x:
                cnt += 1
print(cnt)

Fixed, accepted submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if 500 * i + 100 * j + 50 * k == x:
                cnt += 1
print(cnt)
Problem:
Write a program which reads a list of student test scores and evaluates the performance for each student.  The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup examination r (out of 100). If the student does not take the examination, the score is indicated by -1.  The final performance of a student is evaluated by the following procedure:    * If the student does not take the midterm or final examination, the student's grade shall be F.   * If the total score of the midterm and final examination is greater than or equal to 80, the student's grade shall be A.   * If the total score of the midterm and final examination is greater than or equal to 65 and less than 80, the student's grade shall be B.   * If the total score of the midterm and final examination is greater than or equal to 50 and less than 65, the student's grade shall be C.   * If the total score of the midterm and final examination is greater than or equal to 30 and less than 50, the student's grade shall be D. However, if the score of the makeup examination is greater than or equal to 50, the grade shall be C.   * If the total score of the midterm and final examination is less than 30, the student's grade shall be F.

Incorrect submission (verdict: Wrong Answer):
import sys
def main():
    for line in sys.stdin:
        m, f, r = map(int, line.split())
        if m == -1 and f == -1 and r == -1:
            break
        else:
            total = m * f
            if m == -1 or f == -1:
                print("F")
            elif total >= 80:
                print("A")
            elif 65 <= total < 80:
                print("B")
            elif 50 <= total < 65:
                print("C")
            elif 30 <= total < 50:
                if r >= 50:
                    print("C")
                else:
                    print("D")
            elif total < 30:
                print("F")


if __name__ == "__main__":
    main()

Fixed, accepted submission:
import sys
def main():
    for line in sys.stdin:
        m, f, r = map(int, line.split())
        if m == -1 and f == -1 and r == -1:
            break
        else:
            total = m + f
            if m == -1 or f == -1:
                print("F")
            elif total >= 80:
                print("A")
            elif 65 <= total < 80:
                print("B")
            elif 50 <= total < 65:
                print("C")
            elif 30 <= total < 50:
                if r >= 50:
                    print("C")
                else:
                    print("D")
            elif total < 30:
                print("F")


if __name__ == "__main__":
    main()
Problem:
There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.  Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.    * A Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B.   * An overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B-th or above among all overseas students.  A string S is assigned indicating attributes of all participants. If the i-th character of string S is `a`, this means the participant ranked i-th in the Qualification contests is a Japanese student; `b` means the participant ranked i-th is an overseas student; and `c` means the participant ranked i-th is neither of these.  Write a program that outputs for all the participants in descending rank either `Yes` if they passed the Qualification contests or `No` if they did not pass.

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

a_counter = 0
b_counter = 0

for i in range(N):
  s = S[0]
  if s == "a" and a_counter + b_counter <=A+B:
    a_counter += 1
    print("Yes")
  elif s == "b" and b_counter <= B and a_counter + b_counter <=A+B:
    b_counter += 1
    print("Yes")
  else:
    print("No")
  
  S = S[1:]

Fixed, accepted submission:
#!/usr/bin/env python3

# from numba import njit

# from collections import Counter
# from itertools import accumulate
# import numpy as np
# from heapq import heappop,heappush
# from bisect import bisect_left


def solve(n,a,b,s):
  ans = [""]*n
  japaneseStudents = 0
  foreignStudents = 0
  for i in range(n):
    if s[i] == "a" and japaneseStudents + foreignStudents < a+b:
      ans[i] = "Yes"
      japaneseStudents += 1
    elif s[i] == "b" and japaneseStudents + foreignStudents < a+b and foreignStudents < b:
      ans[i] = "Yes"
      foreignStudents += 1
    else:
      ans[i] = "No"
  return ans



def main():
  N,A,B = map(int,input().split())
  s = input()
  ans = solve(N,A,B,s)
  for i in range(N):
    print(ans[i])
  return

if __name__ == '__main__':
  main()
Problem:
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd.

Incorrect submission (verdict: Wrong Answer):
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    },
    {
     "ename": "ValueError",
     "evalue": "not enough values to unpack (expected 2, got 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-5-6f6a0d3392e7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[1;32min\u001b[0m \u001b[0minput\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msplit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m%\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'even'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'odd'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: not enough values to unpack (expected 2, got 1)"
     ]
    }
   ],
   "source": [
    "a,b=(int(x) for x in input().split())\n",
    "if (a * b) % 1:\n",
    "    print('even')\n",
    "else:\n",
    "    print('odd')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}


Fixed, accepted submission:
a,b=(int(x) for x in input().split())

#print((a * b) % 2)

if (a * b) % 2 == 1:
    print('Odd')
else:
    print('Even')
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):
import sys
A,B,X = map(int,input().split())
if not ( 1 <= A <= 100 and 1 <= B <= 100 and 1 <= X <= 200 ):
    sys.exit()

if (B + A) >= X and A <= X:
    print('Yes')
else:
    print('No')

Fixed, accepted submission:
import sys
A,B,X = map(int,input().split())
if not ( 1 <= A <= 100 and 1 <= B <= 100 and 1 <= X <= 200 ):
    sys.exit()

if (B + A) >= X and A <= X:
    print('YES')
else:
    print('NO')
Problem:
Takahashi wants to gain muscle, and decides to work out at AtCoder Gym.  The exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up. These buttons are numbered 1 through N. When Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It is possible that i=a_i. When Button i is not lighten up, nothing will happen by pressing it.  Initially, Button 1 is lighten up. Takahashi wants to quit pressing buttons when Button 2 is lighten up.  Determine whether this is possible. If the answer is positive, find the minimum number of times he needs to press buttons.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
A = [int(input()) for i in range(N)]
B = 1
for j in(A):
  if j == 2:
    print(B)
    break
  else:
    B += 1
   
   

Fixed, accepted submission:
N = int(input())
A = [int(input()) for i in range(N)]
B = 0
C = 1
for j in range(N):
  if A[B] == 2:
    print(C)
    break
  elif j == N-1:
    print('-1')
  else:
    B = A[B]-1
    C += 1
Problem:
Let's arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, ... 9). For example, 'eight of heart' is represented by H8 and 'one of diamonds' is represented by D1.  Your task is to write a program which sorts a given set of cards in ascending order by their values using the Bubble Sort algorithms and the Selection Sort algorithm respectively. These algorithms should be based on the following pseudocode:                 BubbleSort(C) 1 for i = 0 to C.length-1 2     for j = C.length-1 downto i+1 3         if C[j].value < C[j-1].value 4             swap C[j] and C[j-1]                 SelectionSort(C) 1 for i = 0 to C.length-1 2     mini = i 3     for j = i to C.length-1 4         if C[j].value < C[mini].value 5             mini = j 6     swap C[i] and C[mini]   Note that, indices for array elements are based on 0-origin.  For each algorithm, report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).

Incorrect submission (verdict: Wrong Answer):
N = int(input())
array = list(input().split())
array2 = array[:]
array3 = array[:]

def bubble_sort(array, N):
	flag = 1
	i = 0
	while flag:
		flag = 0 
		j = N-1
		while j > i:
			if array[j][1] < array[j-1][1]:
				array[j], array[j-1] = array[j-1], array[j]
			j -= 1
			flag = 1
		i += 1


def selection_sort(array, n):
	for i in range(n):
		minij = i 
		for j in range(i, n):
			if array[j][1] < array[minij][1]:
			    minij = j 
		array[i], array[minij] = array[minij], array[i]

def is_stable(Input, output, n):
	for i in range(n):
		for j in range(i+1, n):
			for a in range(n):
				for b in range(a+1, n):
					if Input[i][1] == Input[j][1] and Input[i][1] == output[b][1] and Input[j][1] == output[a][1]:
						return False
	return True 

bubble_sort(array, N)
print(' '.join(array))
print('Stable')
selection_sort(array2,N)
print(' '.join(array2))
if is_stable(array3, array2, N):
	print('Stable')
else:
	print('Not Stable')







Fixed, accepted submission:
N = int(input())
array = list(input().split())
array2 = array[:]
array3 = array[:]

def bubble_sort(array, N):
	flag = 1
	i = 0
	while flag:
		flag = 0 
		j = N-1
		while j > i:
			if array[j][1] < array[j-1][1]:
				array[j], array[j-1] = array[j-1], array[j]
			j -= 1
			flag = 1
		i += 1


def selection_sort(array, n):
	for i in range(n):
		minij = i 
		for j in range(i, n):
			if array[j][1] < array[minij][1]:
			    minij = j 
		array[i], array[minij] = array[minij], array[i]

def is_stable(Input, output, n):
	for i in range(n):
		for j in range(i+1, n):
			for a in range(n):
				for b in range(a+1, n):
					if Input[i][1] == Input[j][1] and Input[i] == output[b] and Input[j] == output[a]:
						return False
	return True 

bubble_sort(array, N)
print(' '.join(array))
print('Stable')
selection_sort(array2,N)
print(' '.join(array2))
if is_stable(array3, array2, N):
	print('Stable')
else:
	print('Not stable')
Problem:
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Incorrect submission (verdict: Wrong Answer):
from statistics import mean 
L=list(map(int,input().split()))
print(int(mean(L))+1)


Fixed, accepted submission:
import math 
a,b=list(map(int,input().split()))
print(math.ceil((a+b)/2))
Problem:
Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).

Incorrect submission (verdict: Wrong Answer):
N, A, B = map(int, input().split())
print(N, A, B)
ans = 0
for i in range(N+1):
    youso_wa = 0
    a = i
    while True:
        amari = int(a % 10)
        a = int(a / 10)
        youso_wa += amari
        if a == 0:
            break
    if youso_wa >= A and youso_wa <= B:
        ans += i
print(ans)

Fixed, accepted submission:
N, A, B = map(int, input().split())
ans = 0
for i in range(N+1):
    youso_wa = 0
    a = i
    while True:
        youso_wa += int(a % 10)
        a = int(a / 10)
        if a == 0:
            break
    if youso_wa >= A and youso_wa <= B:
        ans += i
print(ans)
Problem:
Print all the integers that satisfies the following in ascending order:    * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.

Incorrect submission (verdict: Wrong Answer):
a,b,k=map(int, input().split())
if (b-a)/2<=k:
    for i in range(b-a+1):
        print(a+i)
else:
    for i in range(k):
        print(a+i)
    for i in range(k):
        print(b-i)


Fixed, accepted submission:
a,b,k=map(int, input().split())
if (b-a+1)/2<=k:
    for i in range(b-a+1):
        print(a+i)
else:
    for i in range(k):
        print(a+i)
    for i in range(k):
        print(b-k+1+i)
Problem:
A string is called a KEYENCE string when it can be changed to `keyence` by removing its contiguous substring (possibly empty) only once.  Given a string S consisting of lowercase English letters, determine if S is a KEYENCE string.

Incorrect submission (verdict: Wrong Answer):
S = input()
for i in range(len(S)-7):
  if S[:i]+S[7-i:]=="keyence":
    print("YES")
    break
else:
  print("NO")

Fixed, accepted submission:
S = input()

for i in range(8):
    if S[:i]+S[-(7-i):]=="keyence":
        print("YES")
        break
else:
    print("NO")
Problem:
The word `internationalization` is sometimes abbreviated to `i18n`. This comes from the fact that there are 18 letters between the first `i` and the last `n`.  You are given a string s of length at least 3 consisting of lowercase English letters. Abbreviate s in the same way.

Incorrect submission (verdict: Wrong Answer):
s=input()
count=0
for i in range(len(s)):
    if i == 0 or i == len(s)-1:
        continue
    else:  
        count=count+1

print(count)
r=s[0] + "" + str(count) + "" + s[len(s)-1]

print(r)

Fixed, accepted submission:
s=input()
count=0
for i in range(len(s)):
    if i == 0 or i == len(s)-1:
        continue
    else:  
        count=count+1
r=s[0] + "" + str(count) + "" + s[len(s)-1]

print(r)
Problem:
There is a grid with H horizontal rows and W vertical columns. Let (i, j) denote the square at the i-th row from the top and the j-th column from the left.  For each i and j (1 \leq i \leq H, 1 \leq j \leq W), Square (i, j) is described by a character a_{i, j}. If a_{i, j} is `.`, Square (i, j) is an empty square; if a_{i, j} is `#`, Square (i, j) is a wall square. It is guaranteed that Squares (1, 1) and (H, W) are empty squares.  Taro will start from Square (1, 1) and reach (H, W) by repeatedly moving right or down to an adjacent empty square.  Find the number of Taro's paths from Square (1, 1) to (H, W). As the answer can be extremely large, find the count modulo 10^9 + 7.

Incorrect submission (verdict: Wrong Answer):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**7)

def grid(y,x):
    global dp
    if mp[y][x]!='#' and dp[y][x]==0:
        dp[y][x]=grid(y-1,x)+grid(y,x-1)
        return dp[y][x]
    else:
        return 0


H,W=map(int,input().split())
mp=[['#']*(W+1)]
for _ in range(H):
    mp.append(['#']+list(input()))
mp.append(['#']*(W+1))

dp=[[0]*(W+1)for _ in range(H+1)]
dp[1][1]=1
grid(H,W)
print(dp[H][W]%(10**9+7))


Fixed, accepted submission:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**7)

def grid(y,x):
    global dp,visited
    if visited[y][x]:
        return dp[y][x]
    else:
        visited[y][x]=True
        if mp[y][x]!='#' and dp[y][x]==0:
            dp[y][x]=(grid(y-1,x)+grid(y,x-1))%mod
        return dp[y][x]

H,W=map(int,input().split())
mp=[['#']*(W+1)]
for _ in range(H):
    mp.append(['#']+list(input()))

dp=[[0]*(W+1)for _ in range(H+1)]
dp[1][1]=1
visited=[[False]*(W+1)for _ in range(H+1)]
mod=10**9+7
grid(H,W)
print(dp[H][W])
Problem:
There are 2N squares arranged from left to right. You are given a string of length 2N representing the color of each of the squares.  The color of the i-th square from the left is black if the i-th character of S is `B`, and white if that character is `W`.  You will perform the following operation exactly N times: choose two distinct squares, then invert the colors of these squares and the squares between them. Here, to invert the color of a square is to make it white if it is black, and vice versa.  Throughout this process, you cannot choose the same square twice or more. That is, each square has to be chosen exactly once.  Find the number of ways to make all the squares white at the end of the process, modulo 10^9+7.  Two ways to make the squares white are considered different if and only if there exists i (1 \leq i \leq N) such that the pair of the squares chosen in the i-th operation is different.

Incorrect submission (verdict: Wrong Answer):
def main():
    N = int(input())
    S = input()
    div = pow(10, 9) + 7
    facN = 1
    for i in range(1, N+1):
        facN = (facN * i) % div

    if S[0] == "W": return 0

    count = 1
    for i in range(2*N):
        if S[i] == "B":
            count *= (i+2) // 2
        else:
            count *= (i+2) // 2

    return count // 2


if __name__ == '__main__':

    print(main())

Fixed, accepted submission:
def main():
    N = int(input())
    S = input()
    div = pow(10, 9) + 7
    facN = 1
    for i in range(1, N+1):
        facN = (facN * i) % div

    if S[0] != "B": return 0
    t = "L"
    ctL, ctR = 1, 0
    for i in range(1, 2*N):
        if S[i-1] != S[i]:
            t += t[-1]
        else:
            if t[-1] == "L":
                t += "R"
            else:
                t += "L"
        if t[-1] == "L": ctL += 1
        else: ctR += 1
    if S[-1] != "B":
        return 0
    if ctL != ctR: return 0

    prefixL = [0]
    for c in t:
        if c == "L":
            prefixL.append(prefixL[-1]+1)
        else:
            prefixL.append(prefixL[-1])

    # print(S, t)
    # print(prefixL)
    ans = 1
    countR = 0
    for i in range(len(t)):
        if t[i] == "R":
            ans *= prefixL[i] - countR
            ans %= div
            countR += 1
    return (ans * facN) % div

if __name__ == '__main__':

    print(main())
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 and x-a<=b:
  print("Yes")
else:
  print("No")

Fixed, accepted submission:
a, b, x = map(int, input().split())
if a<=x and x-a<=b:
  print("YES")
else:
  print("NO")
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())
if not (a % 3) * (b % 3) * ((a + b) % 3) :
    print("Posiible")
else: 
    print("Impossible")

Fixed, accepted submission:
a, b = map(int, input().split())
if not (a % 3) * (b % 3) * ((a + b) % 3) :
    print("Possible")
else: 
    print("Impossible")
Problem:
Write a program which reads two integers x and y, and prints them in ascending order.

Incorrect submission (verdict: Wrong Answer):
import sys

def main():
    for line in iter(sys.stdin.readline, ""):
        a = line.split(" ")
        if (a[0] == 0 and a[1] == 0):
            break;

        print(min(a) + " " + max(a))
     
if __name__ == "__main__":
    main()

Fixed, accepted submission:
import sys

def main():
    for line in iter(sys.stdin.readline, ""):
        a = line.rstrip("\n").split(" ")
        b = []
        b.append(int(a[0]))
        b.append(int(a[1]))
        if (b[0] == 0 and b[1] == 0):
            return

        print(str(min(b)) + " " + str(max(b)))
     
if __name__ == "__main__":
    main()