TnT/CodeNet4Repair huggingface dataset:
Problem:
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.  You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.  Find B_i for each i = 1, 2, ..., N.

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

m1 = X[int(N/2) - 1]
m2 = X[int(N/2)]

for i in range(N):
    if i < N/2:
        print(m2)
    else:
        print(m1)


Fixed, accepted submission:

N = int(input())
X = list(map(int,input().split()))

Xs = sorted(X)
m1 = Xs[int(N/2)-1]
m2 = Xs[int(N/2)]

for x in X:
    if x < m2:
        print(m2)
    else:
        print(m1)
Problem:
Your task is to perform a simple table calculation.  Write a program which reads the number of rows r, columns c and a table of r × c elements, and prints a new table, which includes the total sum for each row and column.

Incorrect submission (verdict: Wrong Answer):
r,c = map(int, input().split())
L=[]
for i in range(r):
 al = input()
 print(al, end="")
 AL = list(map(int, al.split()))
 S = sum(AL)
 print(" " + str(S))
 AL. append(S)
 L.append(AL)

for i in range(c):
 S = 0
 for j in range(r):
  S += L[j][c]
 print(str(S) + " ", end="")
print()

Fixed, accepted submission:
r,c = map(int, input().split())
L=[]
for i in range(r):
 al = input()
 print(al, end="")
 AL = list(map(int, al.split()))
 S = sum(AL)
 print(" " + str(S))
 AL. append(S)
 L.append(AL)

for i in range(c):
 S = 0
 for j in range(r):
  S += L[j][i]
 print(str(S) + " ", end="")

S = 0
for j in range(r):
 S += L[j][-1]
print(str(S))
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())
print((x-a)//b)

Fixed, accepted submission:
x=int(input())
a=int(input())
b=int(input())
print(x-a-(x-a)//b*b)
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())
s = []
ans = []
ans_2 = []
ans_3 = []
for i in range(A,B+1):
    s.append(i)
if K>A-B:
    for i in range(A,B+1):
        print(i)
else:
    for i in range(K):
        ans.append(s[i])
    for i in range(K):
        ans_2.append(s[-(i+1)])
    ans_2.sort()
    for i in range(len(ans)):
      ans_3.append(ans[i])
    for i in range(len(ans_2)):
      ans_3.append(ans_2[i])
    for i in range(len(ans_3)-1):
        if ans_3.count(ans_3[i]) != 1:
            ans_3.remove(ans_3[i])
    for i in range(len(ans_3)):
      print(ans_3[i])

Fixed, accepted submission:
A,B,K = map(int,input().split())
k = []
for i in range(A,A+K):
    if A<=i<=B:
        k.append(i)
for i in range(B-K+1,B+1):
    if A<=i<=B:
        k.append(i)
p = set(k)
q = list(p)
q.sort()
for i in range(len(q)):
    print(q[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 a>b:
  if a-v*t<=b-t*w:
    print('Yes')
  else:
    print('No')
elif a<b:
  if a+v*t>=b+w*t:
    print('Yes')
  else:
    print('No')

Fixed, accepted submission:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a>b:
  if a-v*t<=b-t*w:
    print('YES')
  else:
    print('NO')
elif a<b:
  if a+v*t>=b+w*t:
    print('YES')
  else:
    print('NO')
Problem:
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i).  A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, and the y-coordinate of the red point is also smaller than that of the blue point.  At most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.

Incorrect submission (verdict: Wrong Answer):
N=int(input())
A = [0] * N
B = [0] * N
for n in range(N):
  A[n] = [int(x) for x in input().split()]
for n in range(N):
  B[n] = [int(x) for x in input().split()]

B.sort(key=lambda x:x[1])
B.sort()
print(A)
print(B)
ans = 0
for b in B:
  A.sort(key=lambda x:x[1])
  A.sort()
  q = [a for a in A if a[0] < b[0] and a[1] < b[1]]
  q_ = [a for a in A if a[0] >= b[0] or a[1] >= b[1]]
  maxa = -1
  if q:
    for i, qq in enumerate(q):
      if qq[1] > maxa:
        maxi = i
        maxa = qq[1]
    q.pop(maxi)
    ans += 1
  A = q[:] + q_[:]

print(ans)

Fixed, accepted submission:
N=int(input())
A = [0] * N
B = [0] * N
for n in range(N):
  A[n] = [int(x) for x in input().split()]
for n in range(N):
  B[n] = [int(x) for x in input().split()]

B.sort(key=lambda x:x[1])
B.sort()
ans = 0
for b in B:
  A.sort(key=lambda x:x[1])
  A.sort()
  q = [a for a in A if a[0] < b[0] and a[1] < b[1]]
  q_ = [a for a in A if a[0] >= b[0] or a[1] >= b[1]]
  maxa = -1
  if q:
    for i, qq in enumerate(q):
      if qq[1] > maxa:
        maxi = i
        maxa = qq[1]
    q.pop(maxi)
    ans += 1
  A = q[:] + q_[:]

print(ans)
Problem:
Joisino is working as a receptionist at a theater.  The theater has 100000 seats, numbered from 1 to 100000.  According to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).  How many people are sitting at the theater now?

Incorrect submission (verdict: Wrong Answer):
N = int(input())
count = 0
for i in range(N):
    l, r = map(int, input().split())
    count = (r-(l-1))+count

Fixed, accepted submission:
N = int(input())
count = 0
for i in range(N):
    l, r = map(int, input().split())
    count = (r-l)+count+1

print(count)
Problem:
_n_ _q_   _name 1 time1_   _name 2 time2_   ...   _name n timen_    In the first line the number of processes _n_ and the quantum _q_ are given separated by a single space.  In the following _n_ lines, names and times for the _n_ processes are given. _name i_ and _time i_ are separated by a single space.

Incorrect submission (verdict: Wrong Answer):
#ALDS1_3-B Elementary data structures - Queue
n,q = [int(x) for x in input().split()]
Q=[]
for i in range(n):
    Q.append(input().split())
t=0
res=[]
while Q!=[]:
    if int(Q[0][1])<q:
        res.append([Q[0][0],int(Q[0][1])+t])
        t+=int(Q[0][1])
    else:
        Q.append([Q[0][0],int(Q[0][1])-q])
        t+=q
    del Q[0]
for i in res:
    print(i[0]+" "+str(i[1]))

Fixed, accepted submission:
#ALDS1_3-B Elementary data structures - Queue
n,q = [int(x) for x in input().split()]
Q=[]
for i in range(n):
    Q.append(input().split())
t=0
res=[]
while Q!=[]:
    if int(Q[0][1])<=q:
        res.append([Q[0][0],int(Q[0][1])+t])
        t+=int(Q[0][1])
    else:
        Q.append([Q[0][0],int(Q[0][1])-q])
        t+=q
    del Q[0]
for i in res:
    print(i[0]+" "+str(i[1]))
Problem:
Tak has N cards. On the i-th (1 \leq i \leq N) card is written an integer x_i. He is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A. In how many ways can he make his selection?

Incorrect submission (verdict: Wrong Answer):
n, a = map(int, input().split())
X = list(map(int, input().split()))
dp = [ [[0]*(n*a+1) for i in range(n+1)] for j in range(n+1) ]
dp[0][0][0] = 1
for i in range(n):
  for j in range(1, i+2):
    for k in range(j*a+1):
      if k >= X[i]:
        dp[i+1][j][k] = dp[i][j-1][k-X[i]] + dp[i][j][k]
      else:
        dp[i+1][j][k] = dp[i][j][k]
        
ans = 0
for i in range(n):
  for j in range(1, i+2):
    ans += dp[i][j][j*a]
print(ans)
    

Fixed, accepted submission:
import numpy as np

n,a = map(int, input().split())
X = np.array(input().split(), dtype=np.int64)
Y = X-a
U = max(X.max(), a) * n
dp = np.zeros(2*U+1, dtype=np.int64)
dp[U] = 1
for i in range(n):
  y = Y[i]
  if y >= 0:
    dp[y:] = dp[y:] + dp[:2*U+1-y]
  else:
    dp[:y] = dp[:y] + dp[-y:]
print(dp[U]-1)
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):


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

s=list(SI())
a=int(s[0])
ops=["+","-"]
for i in product(ops,repeat=3):
    ans=a
    for j in range(3):
        if i[j]=="+":
            ans+=int(s[j+1])
        else:
            ans-=int(s[j+1])
    if ans==7:
        u=i
        print(i)
        break
print(s[0],end="")
for i in range(3):
    print(u[i]+s[i+1],end="")
print("=7")


            


    
    



    
    


    
    

Fixed, accepted submission:


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

s=list(SI())
a=int(s[0])
ops=["+","-"]
for i in product(ops,repeat=3):
    ans=a
    for j in range(3):
        if i[j]=="+":
            ans+=int(s[j+1])
        else:
            ans-=int(s[j+1])
    if ans==7:
        u=i
        #print(i)
        break
print(s[0],end="")
for i in range(3):
    print(u[i]+s[i+1],end="")
print("=7")
Problem:
You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order.

Incorrect submission (verdict: Wrong Answer):
dic = {
        "a":1,
        "b":2,
        "c":3,
        "d":4,
        "e":5,
        "f":6,
        "g":7,
        "h":8,
        "i":9,
        "j":10,
        "k":11,
        "l":12,
        "m":13,
        "n":14,
        "o":15,
        "p":16,
        "q":17,
        "r":18,
        "s":19,
        "t":20,
        "u":21,
        "v":22,
        "w":23,
        "x":24,
        "y":25,
        "z":26
        }
s = list(input())
t = list(input())
s.sort()
t.reverse()
if dic[s[0]] < dic[s[0]]:
    print("Yes")
else:
    print("No")

Fixed, accepted submission:
s = list(input())
t = list(input())
s = ''.join(sorted(s))
t = ''.join(sorted(t,reverse = True))
if s < t:
    print("Yes")
else:
    print("No")
Problem:
You are given a string S of length N. Among its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.  Here, a subsequence of a string is a concatenation of **one or more** characters from the string without changing the order.

Incorrect submission (verdict: Wrong Answer):
N=int(input())
S=input()
cnt=[1]*26
for i in range(len(S)):
  cnt[ord(S[i])-ord('a')]+=1
ans=1
for i in range(26):
  ans*=cnt[i]
print(ans)

Fixed, accepted submission:
N=int(input())
S=input()
cnt=[1]*26
for i in range(len(S)):
  cnt[ord(S[i])-ord('a')]+=1
ans=1
for i in range(26):
  ans*=cnt[i]
print((ans-1)%(10**9+7))
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 = 0
for i in range(b):
  if a*i+c % b == 0:
    print("YES")
    d = 1
    break
    
if d==0:
  print("NO")

Fixed, accepted submission:
a,b,c = map(int, input().split())
d = 0
for i in range(10000):
  if (a*i+c) % b == 0:
    print("YES")
    d = 1
    break
    
if d==0:
  print("NO")
Problem:
It is September 9 in Japan now.  You are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N?

Incorrect submission (verdict: Wrong Answer):
nStr = input()

if nStr[0] == 9 or nStr[1] == 9:
  print("Yes")
else:
  print("No")


Fixed, accepted submission:
nStr = input()

if nStr[0] == "9" or nStr[1] == "9":
  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):
X=int(input())
temp=100
an=0
while True:
  temp=int(temp*1.01)
  an+=1
  print(temp)
  if temp>X:
    break
print(an-1)
  

Fixed, accepted submission:
X=int(input())
temp=100
an=0
while True:
  temp=int(temp*1.01)
  an+=1
  #print(temp)
  if temp>=X:
    break
print(an)
Problem:
Given is a rooted tree with N vertices numbered 1 to N. The root is Vertex 1, and the i-th edge (1 \leq i \leq N - 1) connects Vertex a_i and b_i.  Each of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.  Now, the following Q operations will be performed:    * Operation j (1 \leq j \leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.  Find the value of the counter on each vertex after all operations.

Incorrect submission (verdict: Wrong Answer):
import numpy as np

N, Q = (int(x) for x in input().split())

dic = {}
for i in range(N) :
    dic[i+1] = []

for i in range(N-1) :
    a, b = (int(x) for x in input().split())
    dic[a].append(b)
    for n in dic.keys() :
        if a in dic[n] :
            dic[n].append(b)

SUM = np.zeros(N, dtype=np.int)

for i in range(Q) :
    p, x = (int(x) for x in input().split())
    SUM[p-1] = SUM[p-1] + x
    print(dic[p])
    for n in dic[p] :
        SUM[n-1] = SUM[-1] + x


print(' '.join(map(str, SUM)))


Fixed, accepted submission:

import numpy as np

N, Q = (int(x) for x in input().split())

dic = {}

for i in range(N-1) :
    #a, b = (int(x) for x in input().split())
    a, b = map(int,input().split())
    dic[b] = a


SUM = [0]*N

for i in range(Q) :
    #p, x = (int(x) for x in input().split())
    p, x = map(int,input().split())
    SUM[p-1] = SUM[p-1] + x

for i in range(N-1) :
    SUM[i+1] += SUM[dic.get(i+2)-1]

print(' '.join(map(str, SUM)))
Problem:
Snuke has N sticks. The length of the i-th stick is l_i.  Snuke is making a snake toy by joining K of the sticks together.  The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy.

Incorrect submission (verdict: Wrong Answer):
N,K=map(int,input().split())
L=list(map(int,input().split()))
L.sort()
L.reverse()
sum(L[:K])

Fixed, accepted submission:
N,K=map(int,input().split())
L=list(map(int,input().split()))
L.sort()
L.reverse()
print(sum(L[:K]))
Problem:
You are given three integers A, B and C.  Determine if there exists an equilateral triangle whose sides have lengths A, B and C.

Incorrect submission (verdict: Wrong Answer):
s = input().split(' ')
maxNum = max(s)
s.remove(maxNum)
if(int(s[0])**2 + int(s[1])**2 == int(maxNum)**2):
   print('Yes')
else:
   print('No')

Fixed, accepted submission:
import sys
s = input().split(' ')
if(float(s[0]) == float(s[1]) and float(s[0]) == float(s[2])):
   print('Yes')
else:
   print('No')
Problem:
We have a grid of H rows and W columns of squares. The color of the square at the i-th row from the top and the j-th column from the left (1 \leq i \leq H, 1 \leq j \leq W) is given to you as a character c_{i,j}: the square is white if c_{i,j} is `.`, and black if c_{i,j} is `#`.  Consider doing the following operation:    * Choose some number of rows (possibly zero), and some number of columns (possibly zero). Then, paint red all squares in the chosen rows and all squares in the chosen columns.  You are given a positive integer K. How many choices of rows and columns result in exactly K black squares remaining after the operation? Here, we consider two choices different when there is a row or column chosen in only one of those choices.

Incorrect submission (verdict: Wrong Answer):
import itertools
import copy

def red_gyou(c, gyou, W):
  for i in range(W):
    c[gyou][i] = 0
    
def red_retsu(c, retsu, H):
  for j in range(H):
    c[j][retsu] = 0
    
def blacks(c, H):
  black = 0
  for i in range(H):
    black += sum(c[i])
  return black

H, W, K = map(int, input().split())
c = []
for i in range(H):
  gyou = []
  colors = input()
  for color in colors:
    if color == '#':
      gyou.append(1) # black
    else:
      gyou.append(0) # white
  c.append(gyou)
tate = list(range(H))
yoko = list(range(W))
answer = 0

for i in range(H+1):
  red_tate = list(itertools.combinations(tate, i))
  for j in range(W+1):
    red_yoko = list(itertools.combinations(yoko, j))
    if not i and j:
      for ry in red_tate:
        cc = copy.deepcopy(c)
        for jj in ry:
          red_retsu(cc, jj, W)
        if blacks(cc, H) == K:
          answer += 1
      continue
    elif i and not j:
      for rt in red_yoko:
        cc = copy.deepcopy(c)
        for ii in rt:
          red_gyou(cc, ii, H)
        if blacks(cc, H) == K:
          answer += 1
      continue
    elif not i and not j:
      continue
    for rt in red_tate:
      for ry in red_yoko:
        cc = copy.deepcopy(c)
        for ii in rt:
          red_gyou(cc, ii, W)
        for jj in ry:
          red_retsu(cc, jj, H)
        if blacks(cc, H) == K:
          answer += 1
print(answer)


Fixed, accepted submission:
import itertools
import copy
def row(c, i, H, W):
  for j in range(W):
    c[i][j] = 0
    
def column(c, j, H, W):
  for i in range(H):
    c[i][j] = 0

def blacks(c, H, W):
  black = 0
  for row in c:
    black += sum(row)
  return black

H, W, K = map(int, input().split())
c = []
for i in range(H):
  c.append([])
  string = input()
  for color in string:
    if color == '#':
      c[-1].append(1)
    else:
      c[-1].append(0)
height = list(itertools.product([0, 1], repeat=H))
weight = list(itertools.product([0, 1], repeat=W))
answer = 0
for tate in height:
  for yoko in weight:
    cc = copy.deepcopy(c)
    for i in range(len(tate)):
      if tate[i]:
        row(cc, i, H, W)
    for j in range(len(yoko)):
      if yoko[j]:
        column(cc, j, H, W)
    if blacks(cc, H, W) == K:
      answer += 1
print(answer)
Problem:
Snuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:    * Red boxes, each containing R red balls   * Green boxes, each containing G green balls   * Blue boxes, each containing B blue balls  Snuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes. How many triples of non-negative integers (r,g,b) achieve this?

Incorrect submission (verdict: Time Limit Exceeded):

R, G, B, N = [int(i) for i in input().split()]

bingo = 0

for r in range(0, 3001):
    for g in range(0, 3001):
        b = (N -(R * r + G * g)) // B
        if b >= 0 and  R * r + G * g + B * b == N:
            bingo += 1

print(bingo)

Fixed, accepted submission:

R, G, B, N = [int(i) for i in input().split()]

bingo = 0

for r in range(N + 1):
    if R * r > N:
        break
    for g in range(N + 1):
        b = (N - (R * r + G * g)) // B
        if b < 0:
            break
        elif R * r + G * g + B * b == N:
            bingo += 1

print(bingo)
Problem:
M-kun is a student in Aoki High School, where a year is divided into N terms.   There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:    * For the first through (K-1)-th terms: not given.   * For each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.  M-kun scored A_i in the exam at the end of the i-th term.   For each i such that K+1 \leq i \leq N, determine whether his grade for the i-th term is **strictly** greater than the grade for the (i-1)-th term.

Incorrect submission (verdict: Wrong Answer):
n, k = map(int, input().split())
al = list(map(int, input().split()))
for i in range(k, n):
    print('yes' if al[i] > al[i - k] else 'No')

Fixed, accepted submission:
n, k = map(int, input().split())
al = list(map(int, input().split()))
for i in range(k, n):
    print('Yes' if al[i] > al[i - k] else 'No')
Problem:
Write a program which reads three integers, and prints them in ascending order.

Incorrect submission (verdict: Wrong Answer):
nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
if a < b < c:
    print(a, b, c)

Fixed, accepted submission:
nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
 
if a <= b <= c:
    print(a, b, c)
 
elif a <= c <= b:
    print(a, c, b)
 
elif b <= a <= c:
    print(b, a, c)
 
elif b <= c <= a:
    print(b, c, a)
 
elif c <= a <= b:
    print(c, a, b)
 
else:
    print(c, b, a)