num = [int(input()) for i in range(10)]
num.sort(reverse=True)
for i in range[0:3]:
    print(num[i])

num = [int(input()) for i in range(10)]
num.sort(reverse=True)
for i in range(3):
    print(num[i])

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00001/Python/s016107060.py", line 3, in <module>
    for i in range[0:3]:
TypeError: 'type' object is not subscriptable


while True:
    try:
        a = int(input())
        b = int(input())
        print(len(str(a + b)))
    except EOFError:
        break

while True:
    try:
        a, b = map(int, input().split(" "))
        print(len(str(a + b)))
    except:
        break

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00002/Python/s313564811.py", line 3, in <module>
    a = int(input())
ValueError: invalid literal for int() with base 10: '5 7'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00006/Python/s441661847.py", line 1, in <module>
    print(input[::-1])
TypeError: 'builtin_function_or_method' object is not subscriptable


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00018/Python/s371735785.py", line 1, in <module>
    print(*sorted(map(int, input().spilt()))[::-1])
AttributeError: 'str' object has no attribute 'spilt'. Did you mean: 'split'?


def ge(arr):
    for i in range(len(arr)):
        tmp = int(arr[i])
        if tmp >= 4:
            tmp += 1
        if tmp >= 6:
            tmp += 1
        arr[i] = str(tmp)

while True:
    n = int(input)
    if n == 0:
        break
    print("".join(ge(list(oct(n))[2:])))

def ge(arr):
    for i in range(len(arr)):
        tmp = int(arr[i])
        if tmp >= 4:
            tmp += 1
        if tmp >= 6:
            tmp += 1
        arr[i] = str(tmp)
    return arr

while True:
    n = int(input())
    if n == 0:
        break
    print("".join(ge(list(oct(n))[2:])))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00208/Python/s656682715.py", line 12, in <module>
    n = int(input)
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'


import copy

(h, w, n) = list(map(int, input().split()))
dis = [[] for i in range(n + 1)]

def setArr(ph):
    global dis
    res = [False for i in range(w + 2)]
    for i, x in enumerate(list(input())):
        if x == "X":
            continue
        res[i + 1] = True
        if x == ".":
            continue
        if x == "S":
            dis[0] = [ph, i + 1]
            continue
        dis[int(x)] = [ph, i + 1]
    return res

arr = [[] for i in range(h + 2)]
arr[0] = [False for i in range(h + 2)]
arr[-1] = [False for i in range(h + 2)]
for i in range(1, h + 1):
    arr[i] = setArr(i)
res = 0
move = [[1, 0], [0, 1], [-1, 0], [0, -1]]

def ze(start, goal):
    arra = copy.deepcopy(arr)
    global res
    queue = [start, [-1, -1]]
    ap = queue.append
    zu = False
    for q in queue:
        if q[0] < 0:
            res += 1
            ap([-1, -1])
            continue
        if not arra[q[0]][q[1]]:
            continue
        for m in move:
            de = [q[0] + m[0], q[1] + m[1]]
            if de == goal:
                res += 1
                zu = True
                break
            if arra[de[0]][de[1]]:
                ap(de)
        if zu:
            break
        arra[q[0]][q[1]] = False

for i in range(n):
    ze(dis[i], dis[i + 1])

print(res)

import copy

(h, w, n) = list(map(int, input().split()))
dis = [[] for i in range(n + 1)]

def setArr(ph):
    global dis
    res = [False for i in range(w + 2)]
    for i, x in enumerate(list(input())):
        if x == "X":
            continue
        res[i + 1] = True
        if x == ".":
            continue
        if x == "S":
            dis[0] = [ph, i + 1]
            continue
        dis[int(x)] = [ph, i + 1]
    return res

arr = [[] for i in range(h + 2)]
arr[0] = [False for i in range(w + 2)]
arr[-1] = [False for i in range(w + 2)]
for i in range(1, h + 1):
    arr[i] = setArr(i)

res = 0
move = [[1, 0], [0, 1], [-1, 0], [0, -1]]

def ze(start, goal):
    arra = copy.deepcopy(arr)
    global res
    queue = [start, [-1, -1]]
    ap = queue.append
    zu = False
    for q in queue:
        if q[0] < 1:
            res += 1
            ap([-1, -1])
            continue
        if not arra[q[0]][q[1]]:
            continue
        for m in move:
            de = [q[0] + m[0], q[1] + m[1]]

            if de == goal:
                res += 1
                zu = True
                break
            if arra[de[0]][de[1]]:
                ap(de)
        if zu:
            break
        arra[q[0]][q[1]] = False

for i in range(n):
    ze(dis[i], dis[i + 1])

print(res)


result = [0] * 3
while 1:
    a, b, c = sorted(list(map(int, input().split())))
    if a + b > c:
        flag = c * c - b * b - a * a
        if flag == 0:
            result[0] += 1
        elif flag > 0:
            result[1] += 1
        else:
            result[2] += 1
print(sum(result), *result)

acute, right, obtuse = 0, 0, 0
while True:
    a, b, c = sorted(map(int, input().split()))
    if a + b <= c:
        print(acute + right + obtuse, right, acute, obtuse)
        break
    d = a**2 + b**2
    e = c**2
    if d == e:
        right += 1
    elif d < e:
        obtuse += 1
    else:
        acute += 1

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00505/Python/s014459241.py", line 3, in <module>
    a, b, c = sorted(list(map(int, input().split())))
EOFError: EOF when reading a line


n, q, s, t = map(int, input().split())
a = [int(input()) for _ in range(n + 1)]
for _ in range(q):
    l, r, x = map(int, input().split())
    for i in range(l, r + 1):
        a[i] += x
    temp = 0
    for i in range(1, n + 1):
        temp += (a[i - 1] - a[i]) * s if a[i] > a[i - 1] else (a[i - 1] - a[i]) * t
    print(temp)

n, q, s, t = map(int, input().split())
a = [int(input()) for _ in range(n + 1)]
for i in range(1, n + 1)[::-1]:
    a[i] -= a[i - 1]
count = 0
for i in range(n + 1):
    count -= a[i] * s if a[i] > 0 else a[i] * t
for _ in range(q):
    l, r, x = map(int, input().split())
    count += a[l] * s if a[l] > 0 else a[l] * t
    a[l] += x
    count -= a[l] * s if a[l] > 0 else a[l] * t
    if r < n:
        count += a[r + 1] * s if a[r + 1] > 0 else a[r + 1] * t
        a[r + 1] -= x
        count -= a[r + 1] * s if a[r + 1] > 0 else a[r + 1] * t
    print(count)


x = input()
while x:
    a, b = x.split(" ")
    print(int(a) + int(b))

import sys

for line in sys.stdin:
    if line == None or line == "/n":
        break
    a, b = line.split(" ")
    print(int(a) + int(b))


import collections

while True:
    N, Q = map(int, input().split())
    if N == 0 and Q == 0:
        break
    D = []
    for _ in range(N):
        i = list(map(int, input().split()))
        del i[0]
        [D.append(ii) for ii in i]
    c = collections.Counter(D)
    cc = c.most_common()
    if cc[0][1] >= Q:
        print(cc[0][0])
    else:
        print(0)

import collections

while True:
    N, Q = map(int, input().split())
    if N == 0 and Q == 0:
        break
    D = []
    for _ in range(N):
        i = list(map(int, input().split()))
        del i[0]
        [D.append(ii) for ii in i]
    if not len(D) == 0:
        c = collections.Counter(D)
        cc = c.most_common()
        # print(cc)
        if cc[0][1] >= Q:
            ans = 1000000
            tmp = cc[0][1]
            for i in range(len(cc)):
                if cc[i][1] == tmp:
                    ans = min(cc[i][0], ans)
            print(ans)
        else:
            print(0)
    else:
        print(0)


while True:
    n, m = map(int, input().split())
    if n == 0 and m == 0:
        break
    h = [0]
    for i in range(n):
        h.append(int(input()) + h[i])
    w = [0]
    for i in range(m):
        w.append(int(input()) + w[i])

    hList = [0] * 1000
    for i in range(n + 1):
        for j in range(i, n + 1):
            if i == j:
                continue
            else:
                hList[abs(h[i] - h[j])] += 1
    wList = [0] * 1000
    for i in range(m + 1):
        for j in range(i, m + 1):
            if i == j:
                continue
            else:
                wList[abs(w[i] - w[j])] += 1

    squareList = []
    for i in range(1000):
        squareList.append(hList[i] * wList[i])
    print(sum(squareList))

while True:
    n, m = map(int, input().split())
    if n == 0 and m == 0:
        break
    h = [0]
    for i in range(n):
        h.append(int(input()) + h[i])
    w = [0]
    for i in range(m):
        w.append(int(input()) + w[i])

    hDict = {}
    for i in range(n + 1):
        for j in range(i, n + 1):
            if i == j:
                continue
            else:
                diff = abs(h[i] - h[j])
                if diff in hDict:
                    hDict[diff] += 1
                else:
                    hDict[diff] = 1
    wDict = {}
    for i in range(m + 1):
        for j in range(i, m + 1):
            if i == j:
                continue
            else:
                diff = abs(w[i] - w[j])
                if diff in wDict:
                    wDict[diff] += 1
                else:
                    wDict[diff] = 1

    ans = 0
    for diff in hDict.keys():
        if diff in wDict:
            ans += hDict[diff] * wDict[diff]
    print(ans)


for i in range(int(input())):
    n, k = map(int, input().split())
    d = list(map(int, input().split()))
    if k >= n:
        print(0)
    elif k == 1:
        d.sort()
        print(d[-1] - d[0])
    else:
        k = [0] * (k - 1)
        d.sort()
        for i in range(1, n):
            if d[i] - d[i - 1] > k[0]:
                k[0] = d[i] - d[i - 1]
                k.sort()
        print(d[-1] - d[0] - sum(k))

for i in range(int(input())):
    t, k = map(int, input().split())
    d = list(map(int, input().split()))
    d = sorted([d[i + 1] - d[i] for i in range(t - 1)])
    print(sum(d[: t - k]) if t > k else 0)


while True:
    a = list(map(str, input().split()))
    if a[0] == "0":
        break
    elif int(a[1]) <= 30:
        print(" ".join(a))
    elif int(a[1]) == 31 and int(a[2]) <= 4:
        print(" ".join(a))
    else:
        a[0] = "?"
        s = int(a[1])
        s -= 30
        a[1] = str(s)
        print(" ".join(a))

while True:
    a = list(map(str, input().split()))
    if a[0] == "#":
        break
    elif int(a[1]) <= 30:
        print(" ".join(a))
    elif int(a[1]) == 31 and int(a[2]) <= 4:
        print(" ".join(a))
    else:
        a[0] = "?"
        s = int(a[1])
        s -= 30
        a[1] = str(s)
        print(" ".join(a))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p01981/Python/s158524109.py", line 5, in <module>
    elif int(a[1]) <= 30:
IndexError: list index out of range


n = int(input())
a = [float(input()) for _ in range(n)]
b = sorted(a)
for i in range(n):
    print(b.index(a[i]) * 3 + b.count(a[i]) - 1)

import bisect

n = int(input())
a = [float(input()) for _ in range(n)]
b = sorted(a)
for i in range(n):
    x = bisect.bisect_left(b, a[i])
    y = bisect.bisect_right(b, a[i])
    print(x * 2 + y - 1)


q = int(input())
for _ in range(q):
    x = input()
    y = input()
    m = len(x)
    n = len(y)
    c = [0] * (n + 1)
    for i in range(m):
        tmp = x[i]
        c_ = c[:]
        for j in range(n):
            if tmp == y[j]:
                c[j + 1] = c_[j] + 1
            elif c[j + 1] < c[j]:
                c[j + 1] = c[j]
    print(c[-1])

def lcs(x, y):
    a = len(x)
    b = len(y)
    c1 = [0] * (b + 1)
    for i in range(a):
        e1 = x[i]
        c2 = c1[:]
        for j in range(b):
            if e1 == y[j]:
                c1[j + 1] = c2[j] + 1
            elif c1[j + 1] < c1[j]:
                c1[j + 1] = c1[j]
    return c1[-1]

n = int(input().rstrip())
ret = []
for i in range(n):
    s1 = input().rstrip()
    s2 = input().rstrip()
    ret.append(lcs(s1, s2))
print(*ret, sep="\\n")


q = int(input())
ans = []
for _ in range(q):
    x = input()
    y = input()
    m = len(x)
    n = len(y)
    c = [0] * (n + 1)
    for i in range(m):
        tmp = x[i]
        c_ = c[:]
        for j in range(n):
            if tmp == y[j]:
                c[j + 1] = c_[j] + 1
            elif c[j + 1] < c[j]:
                c[j + 1] = c[j]
    ans.append(c[-1])

print(*ans, sep="\\n")

def lcs(x, y):
    m = len(x)
    n = len(y)
    c = [0] * (n + 1)
    for i in range(m):
        tmp = x[i]
        c_ = c[:]
        for j in range(n):
            if tmp == y[j]:
                c[j + 1] = c_[j] + 1
            elif c[j + 1] < c[j]:
                c[j + 1] = c[j]
    return c[-1]

q = int(input())
ans = []
for _ in range(q):
    x = input()
    y = input()
    ans.append(lcs(x, y))

print(*ans, sep="\\n")


prime = set([2])
for i in range(3, 100000000, 2):
    for j in prime:
        if i % j == 0:
            break
    else:
        prime.add(i)
n = int(input())
cnt = 0
for i in (int(input()) for _ in range(n)):
    if i in prime:
        cnt += 1
print(cnt)

import sys
from math import *

readline = sys.stdin.readline

def isPrime(x):
    if x == 2 or x == 3:
        return True
    elif x % 2 == 0 or x % 3 == 0:
        return False
    s = ceil(sqrt(x))
    for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
    return True

print(sum(isPrime(int(readline())) for _ in range(int(input()))))


N = int(input())
R = [int(input()) for i in range(N)]

sa = R[N - 1] - R[N - 2]
for i in reversed(range(N)):
    for j in reversed(range(i)):
        tmp = R[i] - R[j]
        if tmp > sa:
            sa = tmp
print(sa)

N = int(input())
R = [int(input()) for i in range(N)]

min_v = R[0]
max_v = R[1] - R[0]
for i in range(1, len(R)):
    if min_v > R[i - 1]:
        min_v = R[i - 1]
    if max_v < R[i] - min_v:
        max_v = R[i] - min_v
print(max_v)


n = int(input())
ls = [int(input()) for _ in range(n)]

p = min(ls) - max(ls)

for i, x in enumerate(ls, 1):
    if i == len(ls):
        break
    v = max(ls[i:]) - x
    if v > p:
        p = v
print(p)

n = int(input())
m = [int(input()) for _ in range(n)]

def fx(raw):
    min_n = raw[0]
    max_n = raw[1] - raw[0]
    for i in raw[1:]:
        if i - min_n >= max_n:
            max_n = i - min_n
        if i < min_n:
            min_n = i
    return max_n

if __name__ == "__main__":
    print(fx(m))


input()
s = list(map(int, input().split()))
input()
t = list(map(int, input().split()))

cnt = 0
for i in t:
    if i in s:
        cnt += 1
print(cnt)

def binary_search(ary, key, imin, imax):
    if imax < imin:
        return False
    else:
        imid = imin + (imax - imin) // 2
        if ary[imid] > key:
            return binary_search(ary, key, imin, imid - 1)
        elif ary[imid] < key:
            return binary_search(ary, key, imid + 1, imax)
        else:
            return True

n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

cnt = 0
for i in t:
    if binary_search(s, i, 0, n - 1):
        cnt += 1
print(cnt)


# -*- coding: utf-8 -*-

input()
s = set(input().split())
input()
t = set(input().split())
print(int(s & t))

# -*- coding: utf-8 -*-

input()
s = set(input().split())
input()
t = set(input().split())
print(len(s & t))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02268/Python/s343168177.py", line 7, in <module>
    print(int(s & t))
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'set'


def binarySearch(array, key):
    left = 0
    right = len(array)
    while left < right:
        mid = (left + right) / 2
        if key == array[mid]:
            return True
        elif key > array[mid]:
            left = mid + 1
        elif key < array[mid]:
            right = mid
        else:
            print("ERROR")
    return False

n = int(input())
s = [int(x) for x in input().split()]
q = int(input())
t = [int(x) for x in input().split()]
a = [x for x in t if binarySearch(s, x)]
print(len(a))

def binarySearch(array, key):
    left = 0
    right = len(array)
    while left < right:
        mid = int((left + right) / 2)
        if key == array[mid]:
            return True
        elif key > array[mid]:
            left = mid + 1
        elif key < array[mid]:
            right = mid
        else:
            print("ERROR")
    return False

n = int(input())
s = [int(x) for x in input().split()]
q = int(input())
t = [int(x) for x in input().split()]
a = [x for x in t if binarySearch(s, x)]
print(len(a))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02268/Python/s716545650.py", line 21, in <module>
    a = [x for x in t if binarySearch(s, x)]
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02268/Python/s716545650.py", line 21, in <listcomp>
    a = [x for x in t if binarySearch(s, x)]
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02268/Python/s716545650.py", line 6, in binarySearch
    if key == array[mid]:
TypeError: list indices must be integers or slices, not float


# -*- coding: utf-8 -*-

import math

x1, y1, x2, y2 = map(int, input().split())
dis = math.sqrt((x1 + x2) * (x1 + x2) + (y1 + y2) * (y1 + y2))
print(dis)

# -*- coding: utf-8 -*-

import math

x1, y1, x2, y2 = map(float, input().split())
dis = math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
print(dis)


# -*- coding: utf-8 -*-

import math

while True:
    n = int(input())

    if n == 0:
        break

    s = list(map(float, input().split()))
    mean = sum(s) / len(s)

    for i in range(len(s)):
        s[i] = (s[i] - sum) * (s[i] - sum)

    variance = sum(s) / len(s)
    stdev = math.sqrt(variance)

    print(stdev)

# -*- coding: utf-8 -*-

import math

while True:
    n = int(input())

    if n == 0:
        break

    s = list(map(float, input().split()))
    mean = sum(s) / len(s)

    for i in range(len(s)):
        s[i] = (s[i] - mean) * (s[i] - mean)

    variance = sum(s) / len(s)
    stdev = math.sqrt(variance)

    print(stdev)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02381/Python/s289178962.py", line 15, in <module>
    s[i] = (s[i] - sum) * (s[i] - sum)
TypeError: unsupported operand type(s) for -: 'float' and 'builtin_function_or_method'


import statistics as st

while True:
    n = float(input())
    if n == 0:
        break
    scores = list(map(float, input().split()))
    std = st.stdev(scores)
    print(std)

import math

while True:
    n = float(input())
    aan = 0
    if n == 0:
        break
    scores = list(map(float, input().split()))
    total = sum(scores)
    avg = total / len(scores)
    for score in scores:
        aan += (score - avg) ** 2
    aa = aan / len(scores)
    a = math.sqrt(aa)
    print(a)


x = input()

ans = x * x * x

print(ans)

x = int(input())

ans = x * x * x

print(ans)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s517488440.py", line 3, in <module>
    ans = x * x * x
TypeError: can't multiply sequence by non-int of type 'str'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s272745096.py", line 3, in <module>
    print(x * x * x)
TypeError: can't multiply sequence by non-int of type 'str'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s376152712.py", line 1, in <module>
    print(input() ** 3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


import sys

args = sys.argv

num = int(args[1])
print(str(num**3))

s = input()
num = int(s)
print(str(num**3))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s550015206.py", line 5, in <module>
    num = int(args[1])
IndexError: list index out of range


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s314503322.py", line 2, in <module>
    print(x**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s272552751.py", line 2, in <module>
    print(number**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s482874964.py", line 3, in <module>
    print(x**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s627402686.py", line 1, in <module>
    print(input() ** 3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s725747490.py", line 2, in <module>
    print(x**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s709080194.py", line 2, in <module>
    print(x**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s234463127.py", line 2, in <module>
    print(n * n * n)
TypeError: can't multiply sequence by non-int of type 'str'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s516531505.py", line 2, in <module>
    print(input**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s645472377.py", line 2, in <module>
    print(N**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s451360688.py", line 2, in <module>
    print(**3)
TypeError: print() argument after ** must be a mapping, not int


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s996581497.py", line 2, in <module>
    print(x**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


s = input("")
ans = s * s * s
print(ans)

user = input("")
num = int(user)
ans = num * num * num
print(ans)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s469089457.py", line 2, in <module>
    ans = s * s * s
TypeError: can't multiply sequence by non-int of type 'str'


input_1 = int(input())
cal = (input_1) ** 3
print(cal)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02388/Python/s257611309.py", line 2, in <module>
    print(x**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


a, b = [int(elem) for elem in input().split]
print(a * b, (a + b) * 2)

a, b = [int(elem) for elem in input().split()]
print(a * b, (a + b) * 2)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s283815234.py", line 1, in <module>
    a, b = [int(elem) for elem in input().split]
TypeError: 'builtin_function_or_method' object is not iterable


nums = input().split()
x = nums[0] * nums[1]
y = nums[0] * 2 + nums[1] * 2
print(str(x) + " " + str(y))

nums = [int(e) for e in input().split()]
x = nums[0] * nums[1]
y = nums[0] * 2 + nums[1] * 2
print(str(x) + " " + str(y))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s858282912.py", line 2, in <module>
    x = nums[0] * nums[1]
TypeError: can't multiply sequence by non-int of type 'str'


n = input()
a, b = int(n.split())
x = a * b
y = 2 * (a + b)
print(x, y)

n = input()
a, b = n.split()
a = int(a)
b = int(b)
x = a * b
y = 2 * (a + b)
print(x, y)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s485129018.py", line 2, in <module>
    a, b = int(n.split())
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s525009394.py", line 1, in <module>
    x = int(input().split(" "))
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'


a, b = map(int, input().split())
print(a * b, 2(a + b))

a, b = map(int, input().split())
print(a * b, 2 * (a + b))

/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s046135584.py:2: SyntaxWarning: 'int' object is not callable; perhaps you missed a comma?
  print(a * b, 2(a + b))
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s046135584.py", line 2, in <module>
    print(a * b, 2(a + b))
TypeError: 'int' object is not callable


a, b = [int(x) for x in input().split(" ")]

print("{} {}".format(a * b, 2 * a + 2 * b))

a, b = [int(x) for x in input().split()]

print("{} {}".format(a * b, 2 * a + 2 * b))


nums = list(map(int, input().split(" ")))
area = nums[0] * nums[1]
perimeter = nums[0] * 2 + nums[1] * 2
print(area + " " + perimeter)

nums = list(map(int, input().split(" ")))
area = nums[0] * nums[1]
perimeter = nums[0] * 2 + nums[1] * 2
print(str(area) + " " + str(perimeter))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s255812565.py", line 4, in <module>
    print(area + " " + perimeter)
TypeError: unsupported operand type(s) for +: 'int' and 'str'


a, b = map(int, input().splot())
print(str(a * b) + str(2 * a + 2 * b))

a, b = map(int, input().split())
print(str(a * b) + " " + str(2 * a + 2 * b))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02389/Python/s991335921.py", line 1, in <module>
    a, b = map(int, input().splot())
AttributeError: 'str' object has no attribute 'splot'. Did you mean: 'split'?


time = int(input)
h = time / 3600
m = (time % 3600) / 60
s = time % 60
print(str(h) + ":" + str(m) + ":" + str(s))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02390/Python/s278670958.py", line 1, in <module>
    time = int(input)
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02390/Python/s450465833.py", line 2, in <module>
    s = x % 60
TypeError: not all arguments converted during string formatting


sho = int(input()) // 60
amari = int(input()) % 60

h = sho // 60
m = sho % 60
s = amari

print("{}:{}:{}".format(h, m, s))

sho, s = divmod(int(input()), 60)
h, m = divmod(sho, 60)
print("{}:{}:{}".format(h, m, s))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02390/Python/s320807078.py", line 2, in <module>
    amari = int(input()) % 60
EOFError: EOF when reading a line


d = input()
a, b, c = map(d.split())

if (a < b) and (b < c):
    print("Yes")
else:
    print("No")

d = input()
a, b, c = map(int, d.split())
if (a < b) and (b < c):
    print("Yes")
else:
    print("No")

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02392/Python/s458135705.py", line 2, in <module>
    a, b, c = map(d.split())
TypeError: map() must have at least two arguments.


a, b, c = map(int, input.split())
if a < b < c:
    print("Yes")
else:
    print("No")

a, b, c = map(int, input().split())
if a < b < c:
    print("Yes")
else:
    print("No")

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02392/Python/s498567988.py", line 1, in <module>
    a, b, c = map(int, input.split())
AttributeError: 'builtin_function_or_method' object has no attribute 'split'


array = input().split().sort()

for i in array:
    print(i, end="")

l = list(map(int, input().split()))
l.sort()
print(l[0], l[1], l[2])

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02393/Python/s939623185.py", line 3, in <module>
    for i in array:
TypeError: 'NoneType' object is not iterable


a = list(map(int, input().split()))
[print(*i) for i in a.sort()]

a = list(map(int, input().split()))
a.sort()
print(" ".join(map(str, a)))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02393/Python/s980569282.py", line 2, in <module>
    [print(*i) for i in a.sort()]
TypeError: 'NoneType' object is not iterable


Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02393/Python/s363098812.py", line 1, in <module>
    print(*sorted.map(int, input().split()))
AttributeError: 'builtin_function_or_method' object has no attribute 'map'


for i in range():
    inpu = int(input())
    if inpu == 0:
        break
    else:
        print("Case %d: %d" % (i, inpu))

for i in range(1, 10001):
    inpu = int(input())
    if inpu == 0:
        break
    else:
        print("Case %d: %d" % (i, inpu))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02396/Python/s685911962.py", line 1, in <module>
    for i in range():
TypeError: range expected at least 1 argument, got 0


i = 1
while True:
    x = int(input)
    if x == 0:
        break
    print(f"Case {i}: {x}")
    i += 1

i = 1
while True:
    x = int(input())
    if x == 0:
        break
    print(f"Case {i}: {x}")
    i += 1

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02396/Python/s606427724.py", line 3, in <module>
    x = int(input)
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'


array = []
x = input()
while x != 0:
    array.append(x)
    x = input()
for i, x in enumerate(array):
    print("Case %d: %d" % (i + 1, x))

array = []
x = input()
while x != "0":
    array.append(x)
    x = input()
for i, x in enumerate(array):
    print("Case %d: %s" % (i + 1, x))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02396/Python/s875412235.py", line 5, in <module>
    x = input()
EOFError: EOF when reading a line


r = int(input())
pi = 3.141592653589793
area = pi * r * r
circum = 2 * pi * r
print(str("{0:.6f}".format(area)) + " " + str("{0:.6f}".format(circum)))

import math

r = float(input())

area = math.pi * r * r
circum = 2 * math.pi * r
print(str("{0:.6f}".format(area)) + " " + str("{0:.6f}".format(circum)))


from math import pi

r = int(input())

# 面積
circle_area = r * r * pi
# 円周
circumference = 2.0 * r * pi

print("{} {}".format(circle_area, circumference))

from math import pi

r = float(input())
print("{} {}".format(r * r * pi, 2 * pi * r))


while True:
    a, op, b = map(str, input().split(" "))
    if a == 0 and b == 0:
        break
    a, b = int(a), int(b)
    if op == "+":
        c = a + b
    elif op == "-":
        c = a - b
    elif op == "*":
        c = a * b
    else:
        c = a / b
    print(c)

while True:
    a, op, b = map(str, input().split(" "))
    if op == "?":
        break
    a, b = int(a), int(b)
    if op == "+":
        c = a + b
    elif op == "-":
        c = a - b
    elif op == "*":
        c = a * b
    else:
        c = a // b
    print(c)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02401/Python/s740971831.py", line 13, in <module>
    c = a / b
ZeroDivisionError: division by zero


x = [int(v) for v in input().split()]
del x[0]
print(min(x), max(x), sum(x))

n = int(input())
x = [int(v) for v in input().split()]
print(min(x), max(x), sum(x))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02402/Python/s204473454.py", line 3, in <module>
    print(min(x), max(x), sum(x))
ValueError: min() arg is an empty sequence


input()
li = map(int, input().split())
print(min(li), max(li), sum(li))

input()
li = list(map(int, input().split()))
print(min(li), max(li), sum(li))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02402/Python/s227796707.py", line 3, in <module>
    print(min(li), max(li), sum(li))
ValueError: max() arg is an empty sequence


n = int(input())
a = map(int, input().split())
print(min(a), max(a), sum(a))

n = int(input())
a = list(map(int, input().split()))
print(min(a), max(a), sum(a))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02402/Python/s610106422.py", line 3, in <module>
    print(min(a), max(a), sum(a))
ValueError: max() arg is an empty sequence


input()

a = list(map(int, input().split()))

s = 0

for i in len(a):
    s = s + i

print(min(a), max(a), s)

input()

a = list(map(int, input().split()))

s = 0

for i in a:
    s = s + i

print(min(a), max(a), s)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02402/Python/s130438338.py", line 7, in <module>
    for i in len(a):
TypeError: 'int' object is not iterable


n = int(input)
lst = list(map(int, input().split()))
print(" ".join(lst[::-1]))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02407/Python/s871236231.py", line 1, in <module>
    n = int(input)
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'


suit = {"S": 0, "H": 1, "C": 2, "D": 3}
suit_keys = list(suit.keys())
deck = [[suit_keys[i] + " " + str(j + 1) for j in range(13)] for i in range(4)]
for _ in range(int(input())):
    card = input().split()
    deck[suit[card[0]]][int(card[1])] = ""
for i in range(4):
    for j in deck[i]:
        if j != "":
            print(j)

suit = {"S": 0, "H": 1, "C": 2, "D": 3}
suit_keys = list(suit.keys())
deck = [[suit_keys[i] + " " + str(j + 1) for j in range(13)] for i in range(4)]
for _ in range(int(input())):
    card = input().split()
    deck[suit[card[0]]][int(card[1]) - 1] = ""
for i in range(4):
    for j in deck[i]:
        if j != "":
            print(j)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02408/Python/s709538093.py", line 6, in <module>
    deck[suit[card[0]]][int(card[1])] = ""
IndexError: list assignment index out of range


n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
b = [int(input()) for _ in range(m)]
for i in a:
    c = 0
    for j, k in i, b:
        c += j * k
    print(c)

n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
b = [int(input()) for _ in range(m)]
for i in a:
    c = 0
    for j, k in zip(i, b):
        c += j * k
    print(c)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02410/Python/s783362048.py", line 6, in <module>
    for j, k in i, b:
ValueError: too many values to unpack (expected 2)


n, m = map(int, input().split())
a = [[None] * n]
b = [None] * m
for i in range(n):
    a[i] = list(map(int, input().split()))
for i in range(m):
    b[i] = int(input())
for i in range(n):
    c = 0
    for j in range(m):
        c += a[i][j] * b[j]
    print(c)

n, m = map(int, input().split())
a = [None] * n
b = [None] * m
for i in range(n):
    a[i] = list(map(int, input().split()))
for i in range(m):
    b[i] = int(input())
for i in range(n):
    c = 0
    for j in range(m):
        c += a[i][j] * b[j]
    print(c)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02410/Python/s486424590.py", line 5, in <module>
    a[i] = list(map(int, input().split()))
IndexError: list assignment index out of range


from sys import stdin
import numpy as np

n, m = [int(x) for x in stdin.readline().rstrip().split()]
a = np.asarray([[int(x) for x in stdin.readline().rstrip().split()] for _ in range(n)])
b = np.asarray([[int(stdin.readline().rstrip())] for _ in range(m)])
c = a.dot(b)
for i in range(n):
    print(*c[i])

from sys import stdin

n, m = [int(x) for x in stdin.readline().rstrip().split()]
a = [[int(x) for x in stdin.readline().rstrip().split()] for _ in range(n)]
b = [[int(stdin.readline().rstrip())] for _ in range(m)]
c = [[0] for _ in range(n)]
for i in range(n):
    for j in range(m):
        c[i][0] += a[i][j] * b[j][0]

for i in range(n):
    print(*c[i])


n, m = map(int, input().split())
List1 = [[0 for i in range(m)] for i in range(n)]
for x in range(n):
    List1[x] = list(map(int, input().split()))
List2 = [int(input()) for _ in range(n)]
sum = [0 for i in range(n)]
for x in range(n):
    for y in range(m):
        sum[x] += List1[x][y] * List2[y]
for x in range(n):
    print(sum[x])

n, m = map(int, input().split())
List1 = [[0 for i in range(m)] for i in range(n)]
for x in range(n):
    List1[x] = list(map(int, input().split()))
List2 = [int(input()) for i in range(m)]
sum = [0 for i in range(n)]
for x in range(n):
    for y in range(m):
        sum[x] += List1[x][y] * List2[y]
for x in range(n):
    print(sum[x])

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02410/Python/s586106678.py", line 9, in <module>
    sum[x] += List1[x][y] * List2[y]
IndexError: list index out of range


n, m = map(int, input().split())
a = []
b = []
for i in range(n):
    a = [list(map(int, input().split()))]
    a[i] += [sum(a[i])]
for i in range(m):
    b += [a[:][i]]
    a += [b]
for i in range(n):
    print(*a[i])

n, m = map(int, input().split())
a = []
b = []
for i in range(n):
    a += [list(map(int, input().split()))]
    a[i] += [sum(a[i])]
for i in range(m + 1):
    b += [sum(x[i] for x in a)]
a += [b]
for i in range(n + 1):
    print(*a[i])

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02413/Python/s373324762.py", line 6, in <module>
    a[i] += [sum(a[i])]
IndexError: list index out of range


print(input().swapcase())

s = input()

for c in s:
    if c.islower():
        print(c.upper(), end="")
    else:
        print(c.lower(), end="")
print()

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02415/Python/s623323382.py", line 3, in <module>
    s = input()
EOFError: EOF when reading a line


count = [0 for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
while True:
    sentence = input()
    if sentence == "":
        break
    for letter in sentence:
        letter.lower()
        num = 0
        for j in alpha:
            if letter == j:
                count[num] += 1
            else:
                num += 1
num = 0
for k in alpha:
    print(k + " : " + str(count[num]))
    num += 1

import sys

s = sys.stdin.read().lower()
count = [0 for i in range(26)]
for j in s:
    num = ord(j) - ord("a")
    if num >= 0 and num <= 25:
        count[num] += 1
for k in range(26):
    print(chr(k + 97) + " : " + str(count[k]))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02417/Python/s778377943.py", line 4, in <module>
    sentence = input()
EOFError: EOF when reading a line


W = input().lower()
T = ""
while True:
    t = input().lower()
    if t == "END_OF_TEXT":
        break
    T += t
print(T.count(W))

W = input().upper()
T = []
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    T += [x.upper() for x in t.split()]
print(T.count(W))

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02419/Python/s097940891.py", line 4, in <module>
    t = input().lower()
EOFError: EOF when reading a line


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

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02472/Python/s921485887.py", line 1, in <module>
    a = int(input())
ValueError: invalid literal for int() with base 10: '5 8'


import sys

def dfs(idx):
    for x in arr[idx]:
        if not vis[x]:
            vis[x] = True
            dfs(x)

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

arr = [[] * (n + 1) for _ in range(n + 1)]
vis = [False] * (n + 1)

for _ in range(m):
    a, b = map(int, sys.stdin.readline().split())
    arr[a].append(b)
    arr[b].append(a)

ans = 0

dfs(1)
for i in range(2, n + 1):
    if not vis[i]:
        vis[i] = True
        dfs(i)
        ans += 1
for i in range(1, n + 1):
    if not vis[i]:
        ans += 1
print(ans)

import sys

sys.setrecursionlimit(10**6)

def dfs(idx):
    for x in arr[idx]:
        if not vis[x]:
            vis[x] = True
            dfs(x)

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

arr = [[] * (n + 1) for _ in range(n + 1)]
vis = [False] * (n + 1)

for _ in range(m):
    a, b = map(int, sys.stdin.readline().split())
    arr[a].append(b)
    arr[b].append(a)

ans = 0

if m == 0:
    print(n - 1)
    sys.exit()

dfs(1)
for i in range(2, n + 1):
    if not vis[i]:
        vis[i] = True
        dfs(i)
        ans += 1

print(ans)


class SegmentTree:
    def __init__(self, n, op, e):
        self.n = 1 << (n - 1).bit_length()
        self.op = op
        self.e = e
        self.data = [e] * (2 * self.n)

    def update(self, k, v):
        k += self.n
        self.data[k] = v
        while k > 0:
            k >>= 1
            self.data[k] = self.op(self.data[2 * k], self.data[2 * k + 1])

    def query(self, left, right):
        left += self.n
        right += self.n
        l_res = self.e
        r_res = self.e
        while left < right:
            if left & 1:
                l_res = self.op(l_res, self.data[left])
                left += 1
            left >>= 1
            if right & 1:
                right -= 1
                r_res = self.op(self.data[right], r_res)
            right >>= 1
        return self.op(l_res, r_res)

N, K, *A = map(int, open(0).read().split())
t = SegmentTree(400_000, max, 0)
dp = [1] * N
ans = 0
for i in range(N):
    a = A[i]
    t.update(a, 1 + t.query(max(1, a - K), a + K + 1))
print(t.query(0, 400_000))

class SegmentTree:
    def __init__(self, n, op, e):
        self.n = 1 << (n - 1).bit_length()
        self.op = op
        self.e = e
        self.data = [e] * (2 * self.n)

    def update(self, k, v):
        k += self.n
        self.data[k] = v
        while k > 0:
            k >>= 1
            self.data[k] = self.op(self.data[2 * k], self.data[2 * k + 1])

    def query(self, left, right):
        left += self.n
        right += self.n
        l_res = self.e
        r_res = self.e
        while left < right:
            if left & 1:
                l_res = self.op(l_res, self.data[left])
                left += 1
            left >>= 1
            if right & 1:
                right -= 1
                r_res = self.op(self.data[right], r_res)
            right >>= 1
        return self.op(l_res, r_res)

N, K, *A = map(int, open(0).read().split())
t = SegmentTree(650_000, max, 0)
ans = 0
for a in A:
    t.update(a, 1 + t.query(max(0, a - K), min(a + K, 300_000) + 1))
print(t.query(0, 300_001))


class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def get_size(self, x):
        x = self.find(x)
        return self.size[x]

N = int(input())

uf = UnionFind(N)

xy = []
min_y = []
for i in range(N):
    x, y = map(int, input().split())
    xy.append((x, y, i))
    min_y.append(y)

xy.sort()

s = set()

for i in range(N):
    x, y, a = xy[i]
    s.add(i)

    remove = set()
    for j in s:
        if j == i:
            continue

        x2, y2, b = xy[j]

        if y2 < y:
            uf.union(b, a)
            root = uf.find(b)
            if min_y[root] > y:
                min_y[root] = y
                remove.add(j)
            else:
                remove.add(i)
    s -= remove

for i in range(N):
    print(uf.get_size(i))

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def get_size(self, x):
        x = self.find(x)
        return self.size[x]

N = int(input())

uf = UnionFind(N)

xy = []
min_y = []
for i in range(N):
    x, y = map(int, input().split())
    xy.append((x, y, i))
    min_y.append(y)

xy.sort()

min_y = N + 1

for i in range(N - 1):
    x, y, a = xy[i]
    x1, y1, b = xy[i + 1]
    min_y = min(min_y, y)
    if min_y != N - i:
        uf.union(a, b)

for i in range(N):
    print(uf.get_size(i))


import networkx as nx

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

S = [list(input()) for _ in range(n)]
G = nx.DiGraph()

start = (n, m)
cnt = 0
goal = (n, m + 1)

for i in range(n):
    for j in range(n):
        if S[i][j] != "#":
            if S[i][j] == "o":
                cnt += 1
                G.add_edge(start, (i, j), capacity=1)
            if i + 1 < n:
                if S[i + 1][j] != "#":
                    G.add_edge((i, j), (i + 1, j), weight=-1)
            if j + 1 < m:
                if S[i][j + 1] != "#":
                    G.add_edge((i, j), (i, j + 1), weight=-1)
            G.add_edge((i, j), goal, capacity=1)
# G.add_node(start, demand=cnt)
# G.add_node(goal, demand=-cnt)
mincostflow = nx.max_flow_min_cost(G, start, goal)
ans = nx.cost_of_flow(G, mincostflow)
print(abs(ans))

import networkx as nx

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

S = [list(input()) for _ in range(n)]
G = nx.DiGraph()

start = (n, m)
cnt = 0
goal = (n, m + 1)

for i in range(n):
    for j in range(m):
        if S[i][j] != "#":
            if S[i][j] == "o":
                cnt += 1
                G.add_edge(start, (i, j), capacity=1)
            if i + 1 < n:
                if S[i + 1][j] != "#":
                    G.add_edge((i, j), (i + 1, j), weight=-1)
            if j + 1 < m:
                if S[i][j + 1] != "#":
                    G.add_edge((i, j), (i, j + 1), weight=-1)
            G.add_edge((i, j), goal, capacity=1)
# G.add_node(start, demand=cnt)
# G.add_node(goal, demand=-cnt)
mincostflow = nx.max_flow_min_cost(G, start, goal)
ans = nx.cost_of_flow(G, mincostflow)
print(abs(ans))


N = input()

if N[len(N) - 1] == "s":
    N += "es"
else:
    N += "s"
print(N)
N = input()

if N[len(N) - 1] == "s":
    N += "es"
else:
    N += "s"
print(N)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02546/Python/s030233294.py", line 8, in <module>
    N = input()
EOFError: EOF when reading a line


N = int(input())
result = 0
for i in range(1, N + 1):
    s = int(N / i) + 1
    for j in range(1, s + 1):
        if N - i * j > 0:
            result = result + 1
        else:
            break
print(result)

N = int(input())
result = 0
for i in range(1, N + 1):
    s = int(N / i) + 1
    for j in range(s + 1, 0, -1):
        if N - i * j > 0:
            result = result + j
            break
print(result)


N = int(input())

result = 0
for A in range(1, N + 1):
    for B in range(1, (N // A) + 1):
        C = N - A * B
        if C == 0:
            continue
        result += 1
print(result)

N = int(input())

result = 0
for A in range(1, N + 1):
    result += (N - 1) // A
print(result)


n = int(input())

# 約数列挙O(√N)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    return divisors

ans = 0
for c in range(1, n):
    ans += len(make_divisors(n - c))
print(ans)

n = int(input())
ans = 0
for a in range(1, n):
    for b in range(1, n):
        if a * b >= n:
            break
        else:
            ans += 1
print(ans)


from collections import Counter

N = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

count = 0
for c in range(1, N):
    d = Counter(prime_factorize(N - c))

    tmp = 1
    for x in d.values():
        tmp *= x + 1
    count += tmp

print(count)

N = int(input())
ans = 0
for a in range(1, N):
    ans += (N - 1) // a
print(ans)


# coding:utf-8
n = int(input())
ans = 0

for a in range(n):
    ans += (n - 1) // a

print(ans)

# coding:utf-8
n = int(input())
ans = 0

for a in range(1, n):
    ans += (n - 1) // a

print(ans)

Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02548/Python/s983821669.py", line 6, in <module>
    ans += (n - 1) // a
ZeroDivisionError: integer division or modulo by zero


p = 998244353
n, k = map(int, input().split())
LRs = [tuple(map(int, input().split())) for _ in range(k)]
A = [0] * (2 * n)
for lj, rj in LRs:
    A[lj] += 1
    A[rj + 1] -= 1
s = 0
for i in range(1, n):
    s = (s + A[i]) % p
    for lj, rj in LRs:
        A[i + lj] += s
        A[i + rj + 1] -= s
print(s)

p = 998244353
n, k = map(int, input().split())
LRs = [tuple(map(int, input().split())) for _ in range(k)]
A = [0] * (2 * n + 1)
for lj, rj in LRs:
    A[lj] += 1
    A[rj + 1] -= 1
s = 0
for i in range(1, n):
    s = (s + A[i]) % p
    for lj, rj in LRs:
        A[i + lj] += s
        A[i + rj + 1] -= s
print(s)


N, K = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(K)]

dp = [0] * (N + 1)
dpsum = [0] * (N + 1)
dp[1] = 1
dpsum[1] = 1
for i in range(2, N + 1):
    for j in range(K):
        li = max(i - LR[j][1], 1)
        ri = i - LR[j][0]
        if ri < 0:
            continue
        dp[i] += dpsum[ri] - dpsum[li - 1]
    dpsum[i] = dpsum[i - 1] + dp[i]

print(dp[N] % 998244353)

N, K = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(K)]

mod = 998244353
dp = [0] * (N + 1)
dpsum = [0] * (N + 1)
dp[1] = 1
dpsum[1] = 1
for i in range(2, N + 1):
    for j in range(K):
        li = max(i - LR[j][1], 1)
        ri = i - LR[j][0]
        if ri < 0:
            continue
        dp[i] += dpsum[ri] - dpsum[li - 1]
        dp[i] %= mod
    dpsum[i] = dpsum[i - 1] + dp[i]

print(dp[N])


n, k = map(int, input().split())
mod = 998244353
s = list()
for _ in range(k):
    l, r = map(int, input().split())
    s += range(l, r + 1)
s.sort()
dp = [0 for _ in range(n)]
dp[0] = 1
for i in range(n):
    for x in s:
        if x + i > n - 1:
            break
        dp[i + x] = (dp[i + x] + dp[i]) % mod

print(dp[-1])

n, k = map(int, input().split())
LR = [tuple(map(int, input().split())) for _ in range(k)]
dp = [0 for _ in range(n + 1)]
dp[1] = 1
s = 0
mod = 998244353

for i in range(1, n + 1):
    s += dp[i]
    for l, r in LR:
        if i + l <= n:
            dp[i + l] = (dp[i + l] + s) % mod
            if i + r + 1 <= n:
                dp[i + r + 1] = (dp[i + r + 1] - s) % mod

print(dp[n])


def main():
    n, k = map(int, input().split())
    ds = set()
    for _ in range(k):
        l, r = map(int, input().split())
        ds = ds | {i for i in range(l, r + 1)}
    dp = [0] * (n + 1)
    dp[1] = 1

    for i in range(1, n + 1):
        for d in ds:
            if i + d <= n:
                dp[i + d] = (dp[i + d] + dp[i]) % 998244353

    print(dp[-1] % 998244353)

if __name__ == "__main__":
    main()

def main():
    n, k = map(int, input().split())
    lr = [list(map(int, input().split())) for _ in range(k)]
    dp = [0] * (n + 1)
    dp[1] = 1
    dpsum = [0] * (n + 1)
    dpsum[1] = 1
    mod = 998244353

    for i in range(2, n + 1):
        for j in range(k):
            li = i - lr[j][1]
            ri = i - lr[j][0]
            if ri < 0:
                continue
            dp[i] = (dp[i] + dpsum[ri] - dpsum[li - 1]) % mod
        dpsum[i] = dpsum[i - 1] + dp[i]

    print(dp[-1] % mod)

if __name__ == "__main__":
    main()


N, K = map(int, input().split())
mod = 998244353

LR = [tuple(map(int, input().split())) for _ in range(K)]
LR.sort()

dp = [0] * (N + 1)
dp[1] = 1
for i in range(1, N):
    if dp[i] <= 0:
        continue
    for L, R in LR:
        for d in range(L, R + 1):
            if i + d < N + 1:
                dp[i + d] += dp[i]
                dp[i + d] %= mod

print(dp[N])

N, K = map(int, input().split())
mod = 998244353

LR = [tuple(map(int, input().split())) for _ in range(K)]
LR.sort()

dpsum = [0] * (N + 1)
dpsum[1] = 1
dp = [0] * (N + 1)
dp[1] = 1

for i in range(2, N + 1):
    for L, R in LR:
        l = i - R
        r = i - L

        if r < 0:
            continue
        l = max(l, 0)

        dp[i] += dpsum[r] - dpsum[l - 1]
        dp[i] %= mod
    dpsum[i] = dpsum[i - 1] + dp[i]

print(dp[N])


S = int(input())
MOD = 10**9 + 7
A = [0] * (S + 1)
A[0] = 1
A[1] = 0
A[2] = 0

cumsum = 1
for i in range(3, len(A)):
    A[i] = cumsum
    cumsum += A[i - 2]
    cumsum %= MOD
print(A[-1])

S = int(input())
if S == 1:
    print(0)
    exit()
MOD = 10**9 + 7
A = [0] * (S + 1)
A[0] = 1
A[1] = 0
A[2] = 0

cumsum = 1
for i in range(3, len(A)):
    A[i] = cumsum
    cumsum += A[i - 2]
    cumsum %= MOD
print(A[-1])


s = int(input())

def dfs(n):
    if n <= 2:
        return 0
    elif n == 3:
        return 1
    else:
        count = 1
        for i in range(3, n + 1):
            count += dfs(n - i)

        return count

ans = dfs(s)
print(ans)

from functools import lru_cache
import sys

sys.setrecursionlimit(2000)

s = int(input())
mod = 10**9 + 7

@lru_cache(maxsize=None)
def dfs(n):
    if n <= 2:
        return 0
    elif n == 3:
        return 1
    else:
        count = 1
        for i in range(3, n + 1):
            count += dfs(n - i)
            count %= mod

        return count % mod

ans = dfs(s)
print(ans)


from typing import List

class DSU:
    def __init__(self, n: int) -> None:
        self._n = n
        self.parent_or_size = [-1] * n

    def merge(self, a: int, b: int) -> int:
        assert 0 <= a <= self._n
        assert 0 <= b <= self._n
        x, y = self.leader(a), self.leader(b)
        if x == y:
            return x
        if -self.parent_or_size[x] < -self.parent_or_size[y]:
            x, y = y, x
        self.parent_or_size[x] += self.parent_or_size[y]
        self.parent_or_size[y] = x
        return x

    def same(self, a: int, b: int) -> bool:
        assert 0 <= a <= self._n
        assert 0 <= b <= self._n
        return self.leader(a) == self.leader(b)

    def leader(self, a: int) -> int:
        assert 0 <= a < self._n
        stack = []
        while self.parent_or_size[a] >= 0:
            stack.append(a)
        for i in stack:
            self.parent_or_size[i] = a
        return a

    def size(self, a: int) -> int:
        assert 0 <= a <= self._n
        return -self.parent_or_size[self.leader(a)]

    def groups(self) -> List[List[int]]:
        leader_buf = [self.leader(i) for i in range(self._n)]
        group_size = [0] * self._n
        for i in leader_buf:
            group_size[i] += 1
        result = [[] for _ in range(self._n)]
        for i in range(self._n):
            result[leader_buf[i]].append(i)
        result = [i for i in result if i]
        return result

n, q = map(int, input().split())
dsu = DSU(n)

for _ in range(q):
    t, u, v = map(int, input().split())
    if t == 0:
        dsu.merge(u, v)
    else:
        print(1 if dsu.same(u, v) else 0)

from typing import List

class DSU:
    def __init__(self, n: int) -> None:
        self._n = n
        self.parent_or_size = [-1] * n

    def merge(self, a: int, b: int) -> int:
        assert 0 <= a <= self._n
        assert 0 <= b <= self._n
        x, y = self.leader(a), self.leader(b)
        if x == y:
            return x
        if -self.parent_or_size[x] < -self.parent_or_size[y]:
            x, y = y, x
        self.parent_or_size[x] += self.parent_or_size[y]
        self.parent_or_size[y] = x
        return x

    def same(self, a: int, b: int) -> bool:
        assert 0 <= a <= self._n
        assert 0 <= b <= self._n
        return self.leader(a) == self.leader(b)

    def leader(self, a: int) -> int:
        assert 0 <= a < self._n
        stack = []
        while self.parent_or_size[a] >= 0:
            stack.append(a)
            a = self.parent_or_size[a]
        for i in stack:
            self.parent_or_size[i] = a
        return a

    def size(self, a: int) -> int:
        assert 0 <= a <= self._n
        return -self.parent_or_size[self.leader(a)]

    def groups(self) -> List[List[int]]:
        leader_buf = [self.leader(i) for i in range(self._n)]
        group_size = [0] * self._n
        for i in leader_buf:
            group_size[i] += 1
        result = [[] for _ in range(self._n)]
        for i in range(self._n):
            result[leader_buf[i]].append(i)
        result = [i for i in result if i]
        return result

n, q = map(int, input().split())
dsu = DSU(n)

for _ in range(q):
    t, u, v = map(int, input().split())
    if t == 0:
        dsu.merge(u, v)
    else:
        print(1 if dsu.same(u, v) else 0)