TnT/CodeNet4Repair huggingface dataset:
Problem:
Binary trees are defined recursively. A binary tree _T_ is a structure defined on a finite set of nodes that either    * contains no nodes, or   * is composed of three disjoint sets of nodes:   \- a root node.   \- a binary tree called its left subtree.   \- a binary tree called its right subtree.    Your task is to write a program which perform tree walks (systematically traverse all nodes in a tree) based on the following algorithms:    1. Print the root, the left subtree and right subtree (preorder).   2. Print the left subtree, the root and right subtree (inorder).   3. Print the left subtree, right subtree and the root (postorder).  Here, the given binary tree consists of _n_ nodes and evey node has a unique ID from 0 to _n_ -1.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
tree = [None for _ in range(N)]
root = set(range(N))

for i in range(N):
    i, l, r = map(int,input().split())
    tree[i] = (l, r)
    root -= {l, r}

root_node = root.pop()

def preorder(i):
    if i == -1:
        return
    (l, r) = tree[i]
    print(" {}".format(i), end = "")
    preorder(l)
    preorder(r)
    
def inorder(i):
    if i == -1:
        return
    (l, r) = tree[i]
    inorder(l)
    print(" {}".format(i), end = "")
    inorder(r)
    
def postorder(i):
    if i == -1:
        return
    (l, r) = tree[i]
    inorder(l)
    inorder(r)
    print(" {}".format(i), end = "")
    
print('Preorder')
preorder(root_node)
print()

print('Inorder')
inorder(root_node)
print()

print('Postorder')
postorder(root_node)
print()

Fixed, accepted submission:
N = int(input())
tree = [None for _ in range(N)]
root = set(range(N))

for i in range(N):
    i, l, r = map(int,input().split())
    tree[i] = (l, r)
    root -= {l, r}

root_node = root.pop()

def preorder(i):
    if i == -1:
        return
    (l, r) = tree[i]
    print(" {}".format(i), end = "")
    preorder(l)
    preorder(r)
    
def inorder(i):
    if i == -1:
        return
    (l, r) = tree[i]
    inorder(l)
    print(" {}".format(i), end = "")
    inorder(r)
    
def postorder(i):
    if i == -1:
        return
    (l, r) = tree[i]
    postorder(l)
    postorder(r)
    print(" {}".format(i), end = "")
    
print('Preorder')
preorder(root_node)
print()

print('Inorder')
inorder(root_node)
print()

print('Postorder')
postorder(root_node)
print()
Problem:
You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.  Assume that initially no person lives in the building.

Incorrect submission (verdict: Wrong Answer):
def print_list(lst) :
	a = ' '.join(list(map(str, lst)))
	print(a)

n = int(input())
lst = [[[0 for w in range(10)] for q in range(3)] for e in range(4)]
for _ in range(n):
	b,f,r,v = list(map(int, input().split()))
	lst[b-1][f-1][r-1] = v 
for i in range(4):
	print("#"*20)
	for j in range(3):
		print_list(lst[i][j])

Fixed, accepted submission:
n = int(input())
capasity = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

for i in range(n):
    b,f,r,v = map(int, input().split())
    capasity[b-1][f-1][r-1] += v
for i in range(4):
    for j in range(3):
        for k in range(10):
            print(' {}'.format(capasity[i][j][k]),end='')
        print()
    if i != 3:
        print('#'*20)
Problem:
In a public bath, there is a shower which emits water for T seconds when the switch is pushed.  If the switch is pushed when the shower is already emitting water, from that moment it will be emitting water for T seconds. Note that it does not mean that the shower emits water for T additional seconds.  N people will push the switch while passing by the shower. The i-th person will push the switch t_i seconds after the first person pushes it.  How long will the shower emit water in total?

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

cost = t

for i in range(n - 1):
    t += min(t, t_l[i] - t_l[i - 1])
print(cost)


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

cost = t

for i in range(1, n):
    cost += min(t, t_l[i] - t_l[i - 1])
print(cost)
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):
N = input()
C5 = 2
C7 = 1
for i in N.split():
  if i == '5':
    C5 -= 1
  elif i == '7':
    C7 -= 1
  else:
    print( 'No' )
    break
else:
  if C5 == 0 and C7 == 0:
    print( 'Yes' )
  else:
    print( 'No' )

Fixed, accepted submission:
N = input()
C5 = 2
C7 = 1
for i in N.split():
  if i == '5':
    C5 -= 1
  elif i == '7':
    C7 -= 1
  else:
    print( 'NO' )
    break
else:
  if C5 == 0 and C7 == 0:
    print( 'YES' )
  else:
    print( 'NO' )
Problem:
You are given a string S of length N consisting of lowercase English letters, and an integer K. Print the string obtained by replacing every character in S that differs from the K-th character of S, with `*`.

Incorrect submission (verdict: Wrong Answer):
import sys

input = sys.stdin.readline


def main():
    n = input()
    s = input()
    k = int(input())
    print("".join([c if c == s[k - 1] else "*" for c in s]))


if __name__ == "__main__":
    main()


Fixed, accepted submission:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    s = input().rstrip()
    k = int(input())
    print("".join([c if c == s[k - 1] else "*" for c in s]))


if __name__ == "__main__":
    main()
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())

Ssum = 0
for i in range(1, n+1):
    tmp = i
    sum = 0
    while i>0 :
        sum = i%10
        i //= 10
    if a<=sum and sum<=b:
        Ssum += tmp

print(Ssum)

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

Ssum = 0
for i in range(1, n+1):
    tmp = i
    sum = 0
    while i>0 :
        sum += i%10
        i //= 10
    if a<=sum and sum<=b:
        Ssum += tmp

print(Ssum)
Problem:
AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of   AtCoDeer will move the second rectangle horizontally so that it connects with the first rectangle. Find the minimum distance it needs to be moved.

Incorrect submission (verdict: Wrong Answer):
W, a, b = map(int, input().split())
print(max(0, max(a, b) - min(a, b)+W))

Fixed, accepted submission:
W, a, b = map(int, input().split())
print(max(0, max(a, b) - (min(a, b) + W)))
Problem:
Snuke has an empty sequence a.  He will perform N operations on this sequence.  In the i-th operation, he chooses an integer j satisfying 1 \leq j \leq i, and insert j at position j in a (the beginning is position 1).  You are given a sequence b of length N. Determine if it is possible that a is equal to b after N operations. If it is, show one possible sequence of operations that achieves it.

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

ans = []
while N > 0:
  ok = False
  for i in range(N)[::-1]:
    b = B[i]
    if b == (i+1):
      ans.append(b)
      ok = True
      break
  
  if ok:
    N -= 1
  else:
    break
    
if N != 0:
  print(-1)
else:
  print("\n".join(map(str,ans[::-1])))

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

ans = []
while N > 0:
  ok = False
  for i in range(N)[::-1]:
    b = B[i]
    if b == (i+1):
      ans.append(b)
      ok = True
      k = i
      break
  
  if not ok:
    break
  else:
    newB = []
    for i in range(N):
      if i != k:
        newB.append(B[i])
    
    B = newB
    N -= 1

if N != 0:
  print(-1)
else:
  print("\n".join(map(str,ans[::-1])))
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-A)%500==0:
    print('Yes')
else:
    print('No')


Fixed, accepted submission:
N=int(input())
A=int(input())
if N%500<=A:
    print('Yes')
else:
    print('No')
Problem:
There is a hotel with the following accommodation fee:    * X yen (the currency of Japan) per night, for the first K nights   * Y yen per night, for the (K+1)-th and subsequent nights  Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee.

Incorrect submission (verdict: Wrong Answer):
# 044_a


N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if ((1 <= N & N <= 10000) & (1 <= K & K <= 10000)) \
        & (1 <= X & X <= 10000) & (1 <= Y & Y <= 10000):
    if (X > Y):
        price = 0
        if (N <= K):
            for i in range(1, N + 1):
                price += X
        if (N > K):
            for i in range(1, K + 1):
                price += X
                for j in range(1, (N - (K + 1))):
                    price += Y
        print(price)

Fixed, accepted submission:
# 044_a


N = int(input())  
K = int(input())  
X = int(input())  
Y = int(input())  

if ((1 <= N & N <= 10000) & (1 <= K & K <= 10000)) \
        & (1 <= X & X <= 10000) & (1 <= Y & Y <= 10000):
    if (X > Y):
        price = 0
        if (N < K):
            for i in range(1, N + 1):
                price += X
        if (N >= K):
            for i in range(1, K + 1):
                price += X
            for j in range(K + 1, N + 1):
                price += Y
        print(price)
Problem:
Joisino is planning to record N TV programs with recorders.  The TV can receive C channels numbered 1 through C.  The i-th program that she wants to record will be broadcast from time s_i to time t_i (including time s_i but not t_i) on Channel c_i.  Here, there will never be more than one program that are broadcast on the same channel at the same time.  When the recorder is recording a channel from time S to time T (including time S but not T), it cannot record other channels from time S-0.5 to time T (including time S-0.5 but not T).  Find the minimum number of recorders required to record the channels so that all the N programs are completely recorded.

Incorrect submission (verdict: Wrong Answer):
n, c = map(int, input().split())
program = [[] for _ in range(c)]

for i in range(n):
  s, t, cc = map(int, input().split())
  program[cc-1].append((s, t))

count = [0]*(10**5+1)
judge = True
for i in range(c):
  program[i].sort()
  l = len(program[i])
  for j in range(l-1):
    if judge:
      count[program[i][j][0]-1] += 1
    if program[i][j][1] == program[i][j+1][0]:
      judge = False
    else:
      judge = True
    if judge:
      count[program[i][j][1]] -= 1
  if l == 0:
    continue
  if judge:
    count[program[i][l-1][0]-1] += 1
  count[program[i][l-1][1]] -= 1

ans = 0
for i in range(10**5+1):
  if i != 0:
    count[i] += count[i-1]
  if ans < count[i]:
    ans = count[i]
print(ans)

Fixed, accepted submission:
n, c = map(int, input().split())
program = [[] for _ in range(c)]

for i in range(n):
  s, t, cc = map(int, input().split())
  program[cc-1].append((s, t))

count = [0]*(10**5+1)
for i in range(c):
  program[i].sort()
  l = len(program[i])
  judge = True
  for j in range(l-1):
    if judge:
      count[program[i][j][0]-1] += 1
    if program[i][j][1] == program[i][j+1][0]:
      judge = False
    else:
      judge = True
    if judge:
      count[program[i][j][1]] -= 1
  if l == 0:
    continue
  if judge:
    count[program[i][l-1][0]-1] += 1
  count[program[i][l-1][1]] -= 1

ans = 0
for i in range(10**5+1):
  if i != 0:
    count[i] += count[i-1]
  if ans < count[i]:
    ans = count[i]
print(ans)
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):
a,b = map(int, input().split())
print(int(a + b + 1 / 2))

Fixed, accepted submission:
a,b = map(int, input().split())
print((a + b + 1) // 2)
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):
n=list(map(int,input()))
if 1<=n.count("9"):
    print("Yes")
else:
    print("No")
    

Fixed, accepted submission:
n=list(map(int,input()))
if 1<=n.count(9):
    print("Yes")
else:
    print("No")
Problem:
Write a program which reads two integers a and b, and calculates the following values:    * a ÷ b: d (in integer)   * remainder of a ÷ b: r (in integer)   * a ÷ b: f (in real number)

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

d = a // b
r = a % b
f = a/b

print(str(d)+" "+str(r)+" "+str(f))

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

d = a // b
r = a % b
f = a/b

#print(str(d)+" "+str(r)+" "+str(f))
print("%d %d %.5f" % (d, r, f))
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())
power = 1

for i in range(1,N+1):
    power = power * i % 1000000007

print(power)


Fixed, accepted submission:
N = int(input())
print(N * 800 - (N // 15) * 200)
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())
ans = []
ans.append(a)
if b-a > k:
    for i in range(1,k):
        ans.append(a+i)
    for j in range(1,k):
        ans.append(b-j)
    ans.append(b)
    for k in range(len(set(ans))):
        print(list(set(ans))[k])
else:
    for i in range(1,b-a):
        ans.append(a+i)
    for j in range(1,b-a):
        ans.append(b-j)
    ans.append(b)
    for k in range(len(set(ans))):
        print(list(set(ans))[k])

Fixed, accepted submission:
a,b,k=map(int,input().split())
ans = []
ans.append(a)
for i in range(min(k,b-a)):
    ans.append(a+i)
for j in range(min(k,b-a)):
    ans.append(b-j)
ans.append(b)
for k in range(len(set(ans))):
    print(sorted(set(ans))[k])
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:
There is a cave.  The cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.  It is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.  Since it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.    * If you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.  Determine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.

Incorrect submission (verdict: Wrong Answer):
from collections import deque
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M,*ab = map(int, read().split())

    E = [[] for _ in range(N+1)]
    for a, b in zip(*[iter(ab)]*2):
        E[a].append(b)
        E[b].append(a)

    par = [0] * (N+1)
    seen = [-1] * (N+1)
    seen[1] = 0
    queue = deque([1])

    while queue:
        v = queue.popleft()
        for e in E[v]:
            if seen[e] == -1:
                seen[e] = seen[v] + 1
                par[e] = v
                queue.append(e)
    
    for i in range(1, N+1):
        if seen[i] == -1:
            print("No")
            exit()
    
    print("\n".join(map(str, par[2:])))

    

if __name__ == "__main__":
    main()


Fixed, accepted submission:
from collections import deque
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M,*ab = map(int, read().split())

    E = [[] for _ in range(N+1)]
    for a, b in zip(*[iter(ab)]*2):
        E[a].append(b)
        E[b].append(a)

    par = [0] * (N+1)
    seen = [-1] * (N+1)
    seen[1] = 0
    queue = deque([1])

    while queue:
        v = queue.popleft()
        for e in E[v]:
            if seen[e] == -1:
                seen[e] = seen[v] + 1
                par[e] = v
                queue.append(e)
    
    for i in range(1, N+1):
        if seen[i] == -1:
            print("No")
            exit()
    
    print("Yes")
    print("\n".join(map(str, par[2:])))

    

if __name__ == "__main__":
    main()
Problem:
Takahashi has N balls. Initially, an integer A_i is written on the i-th ball.  He would like to rewrite the integer on some balls so that there are at most K different integers written on the N balls.  Find the minimum number of balls that Takahashi needs to rewrite the integers on them.

Incorrect submission (verdict: Wrong Answer):
import os
import sys

n,k = map(int, input().split())
a = [x for x in map(int, input().split())]

d = {}
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i] = 1

sorted(d.items(), key=lambda x: x[1])

if(len(d) <= k):
    print(0)
    exit(0)

tmp = len(d)
ans = 0

for i in d.keys():
    tmp-=1
    ans += d[i]
    if(tmp==k):
        break

print(ans)
exit(0)

Fixed, accepted submission:
import os
import sys

n,k = map(int, input().split())
a = [x for x in map(int, input().split())]

d = {}
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i] = 1

s_d = sorted(d.items(), key=lambda x: x[1])

if(len(d) <= k):
    print(0)
    exit(0)

tmp = len(d)
ans = 0


for _,v in s_d:
    tmp-=1
    ans += v
    if(tmp==k):
        break

print(ans)
exit(0)
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())

for i in range(r):
    line = list(map(int, input().split()))
    line.append(sum(line))
    line = map(str, line)
    print(" ".join(line))

Fixed, accepted submission:
r, c = map(int, input().split())
hyou = []
tate_sum = [0] * (c + 1)
for i in range(r):
    line = list(map(int, input().split()))
    line.append(sum(line))
    tate_sum = [tate_sum[j] + line[j] for j in range(len(line))]
    hyou.append(" ".join(map(str, line)))
    
hyou.append(" ".join(map(str, tate_sum)))
print("\n".join(hyou))
Problem:
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.   Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.   Here, both the x\- and y-coordinates before and after each movement must be integers.   He will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).   Here, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).   Under this condition, find a shortest path for him.

Incorrect submission (verdict: Wrong Answer):
sx,sy,tx,ty = map(int,input().split())
a=tx-sx
b=ty-sy
print("U"*b+"R"*a+"D"*b+"L"*a)

Fixed, accepted submission:
sx,sy,tx,ty = map(int,input().split())
a=tx-sx
b=ty-sy
print("U"*b+"R"*a+"D"*b+"L"*a+"L"+"U"*(b+1)+"R"*(a+1)+"D"+"R"+"D"*(b+1)+"L"*(a+1)+"U")
Problem:
Find the largest square number not exceeding N. Here, a _square number_ is an integer that can be represented as the square of an integer.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
i = 1
while(i**2<=N):
  i += 1
print(i-1)

Fixed, accepted submission:
N = int(input())
i = 1
while(i**2<=N):
  i += 1
print((i-1)**2)
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):

# Python 3
from sys import stdin, stdout

if __name__ == "__main__":
    x = stdin.readline()
    x = int(x)

    curr = 101
    ans = 1

    while curr <= x:
        curr *= 101
        curr //= 100
        ans += 1
    
    stdout.write(str(ans) + '\n')





Fixed, accepted submission:

# Python 3
from sys import stdin, stdout

if __name__ == "__main__":
    x = stdin.readline()
    x = int(x)

    curr = 101
    ans = 1

    while curr < x:
        curr *= 101
        curr //= 100
        ans += 1
    
    stdout.write(str(ans) + '\n')
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):
def DepthFirst_search(S,pre):
    global out
    #print(out)
    print('pre = {}'.format(pre))
    if len(S) == 1 :
        if pre + int(S[0]) == 7:
            out = out + '+{}'.format(int(S[0])) + '=7'
            return True
        if pre - int(S[0]) == 7:
            out = out + '-{}'.format(int(S[0])) + '=7'
            return True
        return False

    pre += int(S[0])
    if DepthFirst_search(S[1:len(S)],pre):
        #print(out)
        out = '+' + S[0] + out
        return True
    pre -= 2*int(S[0])
    if DepthFirst_search(S[1:len(S)],pre):
        #print(out)
        out = '-' + S[0] + out
        return True
    return False
out = ''
pre = 0
S = input()
DepthFirst_search(S,pre)

print(out[1:])


Fixed, accepted submission:
def DepthFirst_search(S,pre):
    global out
    #print(out)
    
    if len(S) == 1 :
        if pre + int(S[0]) == 7:
            out = out + '+{}'.format(int(S[0])) + '=7'
            return True
        if pre - int(S[0]) == 7:
            out = out + '-{}'.format(int(S[0])) + '=7'
            return True
        return False

    pre += int(S[0])
    if DepthFirst_search(S[1:len(S)],pre):
        #print(out)
        out = '+' + S[0] + out
        return True
    pre -= 2*int(S[0])
    if DepthFirst_search(S[1:len(S)],pre):
        #print(out)
        out = '-' + S[0] + out
        return True
    return False
out = ''
pre = 0
S = input()
DepthFirst_search(S,pre)

print(out[1:])