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

Incorrect submission (verdict: Wrong Answer):
s = input()
newS = ""
for i in range(len(s)):
    if s[i] == "B":
        if s[0] == "B":
            s = s.replace(s[0],'x')
        else:
            s = s.replace(s[i-1]+s[i],'xx')
            print(s)
ans = s.replace('x','')
print(ans)

Fixed, accepted submission:
s = input()
j = 0
for i in range(len(s)):
    #print("i=",i)
    if s[i-(2*j)] == "B":
        #print(i-(2*j))
        #print(s)
        if s[0] == "B":
            s = 'x'+s[1:]
            #print(s)
            #print(s[0])
        else:
            #print(i-(2*j))
            s = s[:i-1-(2*j)]+s[i-(2*j)+1:]
            j += 1
            
            #print("s=",s)
            #print(s[:i-1-(2*j)-1])
ans = s.replace('x','')
print(ans)
Problem:
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:                 this is a pen   is would become:                 uijt jt b qfo   Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".

Incorrect submission (verdict: Wrong Answer):
x=[i for i in input()]
i=0
y=[0 for i in range(4)]
dif1=0
while(i<len(x)-1):
    s=0
    for j in range(4):
        if (x[j]!=' ')and (x[j]!='.')and (x[j]!='\n'):
            y[j]=x[j]
            s=j
        else:
            s=j
            break       
    if s==3 or s==2:
        dif1=ord(y[0])-ord('t')
        dif2=ord(y[1])-ord('h')
        if dif1==dif2:
            break;
        else:
            i=i+s+1
            
    else:
        i=i+s+1
print(dif1)
for i in range(len(x)):
    if (x[i]!=' ')and (x[i]!='.')and (x[i]!='\n'):
        print(chr(int(ord(x[i]))-dif1),end="")
    else:
        print(x[i],end="")

Fixed, accepted submission:
import sys
a = 'abcdefghijklmnopqrstuvwxyz'
 
for s in sys.stdin:
    for n in range(1, 27):
        t = s[:-1].translate(str.maketrans(a, a[n:] + a[:n]))
        if 'the' in t or 'this' in t or 'that' in t: break
    print(t)
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):

a, b = map(int, input().split())
product = a * b
print('even' if product % 2 == 0 else 'odd')


Fixed, accepted submission:
a, b = map(int, input().split())
product = a * b
print('Even' if product % 2 == 0 else 'Odd')
Problem:
On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in `yyyy/mm/dd` format. For example, January 23, 2018 should be written as `2018/01/23`.  After finishing the document, she noticed that she had mistakenly wrote `2017` at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to `2018` and prints it.

Incorrect submission (verdict: Wrong Answer):
print('2017'+input()[4::])

Fixed, accepted submission:
print('2018'+input()[4::])
Problem:
AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.  If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1). Note that **he cannot stay at his place**. Determine whether he can carry out his plan.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
t0, x0, y0 = 0, 0, 0
for i in range(N):
    t, x, y = map(int, input().split())
    kyori = abs(x - x0) + abs(y - y0)
    time = abs(t0 - t)
    if abs(kyori - time) % 2 == 0 and kyori - time < 0:
        t0, x0, y0 = t, x, y
    else:
        print('No')
        exit(0)
print('Yes')


Fixed, accepted submission:
N = int(input())
t0, x0, y0 = 0, 0, 0
for i in range(N):
    t, x, y = map(int, input().split())
    kyori = abs(x - x0) + abs(y - y0)
    time = abs(t0 - t)
    if abs(kyori - time) % 2 == 0 and time - kyori >= 0:
        t0, x0, y0 = t, x, y
    else:
        print('No')
        exit(0)
print('Yes')
Problem:
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.

Incorrect submission (verdict: Wrong Answer):
str = input()
print(str)
counter = 0

if str[0] == '1':
  counter+=1
if str[1] == '1':
  counter+=1
if str[2] == '1':
  counter+=1

print(counter)

Fixed, accepted submission:
str = input()

counter = 0
if str[0]=='1': counter+=1
if str[1]=='1': counter+=1
if str[2]=='1': counter+=1

print(counter)
Problem:
We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not.  You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S. It is guaranteed that such a non-empty string exists for a given input.

Incorrect submission (verdict: Wrong Answer):
s=list(input())
ss=[]
print(ss)
for i in range((len(s)//2)-1):
    ss.append(s[i])
    if(ss==s[i+1:i+1+len(ss)]):
        print(len(ss)*2)

Fixed, accepted submission:
s=list(input())
ss=[]
ans=[]
for i in range((len(s)//2)):
    ss.append(s[i])
    if(ss==s[i+1:i+1+len(ss)] and ((len(ss)*2)<len(s))):
        ans.append(len(ss)*2)
print(max(ans))
Problem:
In this problem, we use the 24-hour clock.  Takahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.) He has decided to study for K consecutive minutes while he is up. What is the length of the period in which he can start studying?

Incorrect submission (verdict: Wrong Answer):
h1, m1, h2, m2, k = list(map(int, input().split()))

wake = (h2 * 60 + m2) - (h1 * 60 + m1)
print(wake)
just = False
if ((wake % k) == 0):
    just = True

ans = wake // k
if (just):
    ans -= 1

print(ans*k)


Fixed, accepted submission:
h1, m1, h2, m2, k = list(map(int, input().split()))

wake = (h2 * 60 + m2) - (h1 * 60 + m1)

if (wake > k):
    ans = wake - k
else:
    ans = 0

print(ans)
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):
arr = list(map(int, input().split(" ")))

count5 = 0
count7 = 0

for i in arr:
    if i == 5:
        print(i)
        count5 += 1
    if i == 7:
        print(i)
        count7 += 1

if count5 == 2 and count7 == 1:
    print("YES")                                                  
else:
    print("NO")

Fixed, accepted submission:
import sys
input_line  = sys.stdin.readline()
arr = input_line.rstrip().split(" ")

count5 = 0
count7 = 0

for i in arr:
    if int(i) == 5:
        count5 += 1
    if int(i) == 7:
        count7 += 1

if count5 == 2 and count7 == 1:
    print("YES")
else:
    print("NO")
Problem:
N persons are standing in a row. The height of the i-th person from the front is A_i.  We want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person:  Condition: Nobody in front of the person is taller than the person. Here, the height of a person includes the stool.  Find the minimum total height of the stools needed to meet this goal.

Incorrect submission (verdict: Wrong Answer):

item = input().split()
total_num = item[0]
fumidai_sum = 0
before_tall = 0

for idx, tall in enumerate(item[1:]):
  tall = int(tall)
  
  if idx == 0:
    before_tall = tall
    continue
  else:
    if before_tall > tall:
      fumidai_sum += (before_tall - tall)
    else:
      before_tall = tall
      
print(fumidai_sum)

Fixed, accepted submission:
num = int(input())
item = input().split()
res = 0

for i in range(num):
  if i == 0:
    continue
  b = int(item[i - 1])
  t = int(item[i])
  
  if b > t:
    res += (b - t)
    item[i] = b
    
      
print(res)
Problem:
There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

Incorrect submission (verdict: Wrong Answer):
N = int(input())
ans = sum(i**2 for i in range(1,N+1))
print(ans)

Fixed, accepted submission:
N = int(input())
ans = sum(i for i in range(1,N+1))
print(ans)
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):
s=100
x=int(input())
i=0
while True:
  if s>=x:
    break
  s=s*1.01
  i=i+1
  

Fixed, accepted submission:
s=100
i=0
x=int(input())
 
while True:
  if s>=x:
    break
  else:
    i=i+1
    s=int(s*1.01)
    
print(i)
Problem:
You have N items that you want to put them into a knapsack. Item i has value vi and weight wi.  You want to find a subset of items to put such that:    * The total value of the items is as large as possible.   * The items have combined weight at most W, that is capacity of the knapsack.  Find the maximum total value of items in the knapsack.

Incorrect submission (verdict: Wrong Answer):


#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_B&lang=jp
n, w = map(int,input().split())
value = []
weight = []

for i in range(n):
    val,wei = map(int,input().split())
    value.append(val)
    weight.append(wei)
    

dp = []
for i in range(110):
    o = [0 for i in range(1010)]
    dp.append(o)



for ww in range(w):
    dp[0][ww] = 0

for i in range(n):
    for ww in range(w):
        
        if ww >= weight[i] :
            dp[i+1][w] = max(dp[i][w-weight[i]] + value[i], dp[i][w])
        else:
            dp[i+1][w] = dp[i][w]
print(dp[n][w])


Fixed, accepted submission:


#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_B&lang=jp
n, w = map(int,input().split())
value = []
weight = []

for i in range(n):
    val,wei = map(int,input().split())
    value.append(val)
    weight.append(wei)
    

dp = []
for i in range(110):
    o = [0 for i in range(10010)]
    dp.append(o)



for ww in range(w):
    dp[0][ww] = 0

for i in range(0,n):
    for ww in range(w+1):
        
        if ww >= weight[i] :
            dp[i+1][ww] = max(dp[i][ww-weight[i]] + value[i], dp[i][ww])
        else:
            dp[i+1][ww] = dp[i][ww]
print(dp[n][w])
Problem:
Snuke and Raccoon have a heap of N cards. The i-th card from the top has the integer a_i written on it.  They will share these cards. First, Snuke will take some number of cards from the top of the heap, then Raccoon will take all the remaining cards. Here, both Snuke and Raccoon have to take at least one card.  Let the sum of the integers on Snuke's cards and Raccoon's cards be x and y, respectively. They would like to minimize |x-y|. Find the minimum possible value of |x-y|.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
SUM=sum(a)
sum_snuke = 0
sum_araisan = 0
answer = float('inf')
for i in range(1, n):
    sum_snuke += a[i]
    sum_araisan = SUM - sum_snuke
    
    if answer >= abs(sum_snuke - sum_araisan):
        answer = abs(sum_snuke - sum_araisan)

print(answer)

Fixed, accepted submission:
n=int(input())
a=list(map(int,input().split()))
answer = float('inf')
araisan_sum = sum(a) - a[0]
snuke_sum = a[0]
if len(a) == 2:
    answer = abs(snuke_sum - araisan_sum)
else:
    for i in range(1, n-1):
        snuke_sum += a[i]
        araisan_sum -= a[i]
        if answer >= abs(snuke_sum - araisan_sum):
            answer = abs(snuke_sum - araisan_sum)

print(answer)
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):
s = input()
s = ''.join(sorted(s))
t = input()
t = ''.join(sorted(t,reverse=True))
if s>t:
    print('Yes')
else:
    print('No')

Fixed, accepted submission:
s = input()
ns = ''.join(sorted(s))
t = input()
nt = ''.join(sorted(t,reverse=True))
if ns<nt:
    print('Yes')
else:
    print('No')
Problem:
Some number of chocolate pieces were prepared for a training camp. The camp had N participants and lasted for D days. The i-th participant (1 \leq i \leq N) ate one chocolate piece on each of the following days in the camp: the 1-st day, the (A_i + 1)-th day, the (2A_i + 1)-th day, and so on. As a result, there were X chocolate pieces remaining at the end of the camp. During the camp, nobody except the participants ate chocolate pieces.  Find the number of chocolate pieces prepared at the beginning of the camp.

Incorrect submission (verdict: Wrong Answer):
N=int(input())
D,X=(int(i) for i in input().split())
a=[int(input()) for i in range(N)]
goukei=0
for s in range(N):
	c=(D-1)/a[s]+1
	goukei+=c
print(goukei)

Fixed, accepted submission:
N=int(input())
D,X=(int(i) for i in input().split())
a=[int(input()) for i in range(N)]
for s in range(N):
	c=(D-1)//a[s]+1
	X+=c
print(X)
Problem:
There is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.  Snuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).  Then, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:    * If a_i = 1, he painted the region satisfying x < x_i within the rectangle.   * If a_i = 2, he painted the region satisfying x > x_i within the rectangle.   * If a_i = 3, he painted the region satisfying y < y_i within the rectangle.   * If a_i = 4, he painted the region satisfying y > y_i within the rectangle.  Find the area of the white region within the rectangle after he finished painting.

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

high = h
low = 0
left = 0
right = w

for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        left = max(left, x)
    elif a == 2:
        right = max(right, x)
    elif a == 3:
        low = max(low, y)
    elif a == 4:
        high = max(high, y)

print(max(high - low, 0)*max(right - left, 0))

Fixed, accepted submission:
w, h, n = map(int, input().split())
b = 0
l = 0

for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        l = max(l, x)
    elif a == 2:
        w = min(w, x)
    elif a == 3:
        b = max(b, y)
    else:
        h = min(h, y)

print(max(h - b, 0)*max(w - l, 0))
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())
List = list(map(int, input().split()))
ans = 0
while all(i%2 == 0 for i in List):
  a = [i/2 for i in List]
  ans += 1
print(ans)

Fixed, accepted submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0
while all(i%2 == 0 for i in a):
  a = [i/2 for i in a]
  ans += 1
print(ans)
Problem:
Evi has N integers a_1,a_2,..,a_N. His objective is to have N equal **integers** by transforming some of them.  He may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).  Find the minimum total cost to achieve his objective.

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

x = sum(A)/len(A)
ans = 0
for i in A:
    ans += (i - x)**2
print(-(-ans//1))

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

x = sum(A)/len(A)
totals = []
for i in range(min(A), max(A)+1):
    total = 0
    for a in A:
      total += (a-i)**2
    totals.append(total)
print(min(totals))
Problem:
Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.  

Incorrect submission (verdict: Wrong Answer):
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
x, y = map(int, input().split())
print("Yes" if x in a == y in a and x in b == y in b and x in c == y in c else "No")

Fixed, accepted submission:
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
x, y = map(int, input().split())
print("Yes" if (x in a and y in a) or (x in b and y in b) or (x in c and y in c) else "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):
print((int(input())+int(input()))*int(input())/2)

Fixed, accepted submission:
print(int((int(input())+int(input()))*int(input())/2))
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):
C1=input()
C2=input()
ans='Yes'
for i in range(3):
    if C1[i]!=C2[2-i]:
        ans='No'
print(ans)

Fixed, accepted submission:
C1=input()
C2=input()
if C1==C2[::-1]:
    print('YES')
else:
    print('NO')
Problem:
There is a game that involves three variables, denoted A, B, and C.  As the game progresses, there will be N events where you are asked to make a choice. Each of these choices is represented by a string s_i. If s_i is `AB`, you must add 1 to A or B then subtract 1 from the other; if s_i is `AC`, you must add 1 to A or C then subtract 1 from the other; if s_i is `BC`, you must add 1 to B or C then subtract 1 from the other.  After each choice, none of A, B, and C should be negative.  Determine whether it is possible to make N choices under this condition. If it is possible, also give one such way to make the choices.

Incorrect submission (verdict: Wrong Answer):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def _solve(A, B, C, S):
    counter = {'A': A, 'B': B, 'C': C}
    last = S[0][0]
    answer = []
    for s in S:
        if s[0] == last:
            counter[s[0]] -= 1
            counter[s[1]] += 1
            if counter[s[0]] < 0:
                return None
            answer.append(s[1])
        else:
            counter[s[1]] -= 1
            counter[s[0]] += 1
            if counter[s[1]] < 0:
                return None
            answer.append(s[0])
        last = s[1]
    return answer



def solve():
    N, A, B, C = read_ints()
    S = []
    for _ in range(N):
        S.append(input().strip())
    answer = _solve(A, B, C, S)
    if answer is None:
        S[0] = S[0][1]+S[0][0]
        answer = _solve(A, B, C, S)
        if answer is None:
            print('No')
            return
    for a in answer:
        print(a)


if __name__ == '__main__':
    solve()


Fixed, accepted submission:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))

def third(x, y):
    return (set('ABC')-set([x,y])).pop()

def other(S, c):
    if S[0] == c:
        return S[1]
    return S[0]

def _solve(A, B, C, S):
    counter = {'A': A, 'B': B, 'C': C}
    answer = []
    i = 0
    while i < len(S):
        s = S[i]
        if counter[s[0]] > 0:
            counter[s[0]] -= 1
            counter[s[1]] += 1
            answer.append(s[1])
        elif counter[s[1]] > 0:
            counter[s[0]] += 1
            counter[s[1]] -= 1
            answer.append(s[0])
        else:
            if i == 0:
                return None
            if S[i-1][0] in s:
                prev_dest = S[i-1][1]
                prev_src = S[i-1][0]
            else:
                prev_dest = S[i-1][0]
                prev_src = S[i-1][1]
            answer.pop()
            answer.append(prev_src)
            counter[prev_dest] -= 2
            counter[prev_src] += 2
            if counter[prev_dest] < 0:
                return None
            i -= 1
        i += 1
    return answer



def solve():
    N, A, B, C = read_ints()
    S = []
    for _ in range(N):
        S.append(input().strip())
    answer = _solve(A, B, C, S)
    if answer is None:
        print('No')
        return
    print('Yes')
    for a in answer:
        print(a)


if __name__ == '__main__':
    solve()
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):
s = input()
print("no" if len(s)-len(set(s)) else "yes")

Fixed, accepted submission:
n,k = map(int,input().split())
print(sum(sorted(map(int,input().split()))[::-1][:k]))
Problem:
There are N cities and M roads. The i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirectionally. There may be more than one road that connects the same pair of two cities. For each city, how many roads are connected to the city?

Incorrect submission (verdict: Wrong Answer):
n,m = map(int, input().split())
roads = [list(map(lambda x:int(x)-1, input().split())) for _ in range(m)]

for r in roads:
    print(r)

arr = [0]*n
for r in roads:
    arr[r[0]] +=1
    arr[r[1]] +=1

for a in arr:
    print(a)

Fixed, accepted submission:
n,m = map(int, input().split())
roads = [list(map(lambda x:int(x)-1, input().split())) for _ in range(m)]

arr = [0]*n
for r in roads:
    arr[r[0]] +=1
    arr[r[1]] +=1

for a in arr:
    print(a)