Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3

from collections import defaultdict


class Graph(object):
    """ Graph data structure, undirected by default. """

    def __init__(self, connections, directed=False):
        self._graph = defaultdict(set)
        self._directed = directed
        self.add_connections(connections)

    def add_connections(self, connections):
        """ Add connections (list of tuple pairs) to graph """

        for u, v in connections:
            self.add(u, v)

    def add(self, u, v):
        """ Add connection between node u and node v """

        self._graph[u].add(v)
        if not self._directed:
            self._graph[v].add(u)

    def get_adj(self, v):
        """ Get adjacency list of node v """
        return self._graph[v]

    def __str__(self):
        return '{}({})'.format(self.__class__.__name__, dict(self._graph))


# -----
N, Q = map(int, input().split())
connections = []
for _ in range(N - 1):
    a, b = map(int, input().split())
    connections.append((a, b))
query = []
for _ in range(Q):
    p, x = map(int, input().split())
    query.append([p, x])
# print(N, Q)
# print(connections, query)

g = Graph(connections, directed=True)
# print(g)

keys = [v for v in range(1, N + 1)]
values = [0 for _ in range(N)]
counter = dict(zip(keys, values))
# print(counter)
for p, x in query:
    counter[p] += x


def dfs(g, v, parent):
    if v != 1:
        counter[v] += counter.get(parent)
    for v_next in g.get_adj(v):
        dfs(g, v_next, v)


keys = [v for v in range(1, N + 1)]
values = [False for _ in range(N)]
seen = dict(zip(keys, values))
root = 1
dfs(g, root, None)

for c in counter.values():
    print(c, end=" ")


### FIXED CODE ###

#!/usr/bin/env python3

import sys

input = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 6)

N, Q = map(int, input().split())

edges = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)

query = []
for _ in range(Q):
    p, x = map(int, input().split())
    query.append([p, x])

counter = [0 for _ in range(N)]
for p, x in query:
    counter[p - 1] += x


def dfs(v, parent):
    for v_next in edges[v]:
        if v_next != parent:
            counter[v_next] += counter[v]
            dfs(v_next, v)


root = 0
dfs(root, None)

print(*counter)
a,b,c = int(input())
if b-c == c-a:
    print('Yes')
else:
    print('No')
    

### FIXED CODE ###

a,b,c = map(int,input().split())
if b-a == c-b:
    print('YES')
else:
    print('NO')
n=int(input())
s=list(input())
k=[0]
for i in range(0,n):
    if s[i]=='I':k.append(int(k[i]+1)
    else:k.append(int(k[i]-1))
print(max(k))

### FIXED CODE ###

n=int(input())
s=list(input())
k=[0]
for i in range(0,n):
    if s[i]=='I':k.append(int(k[i]+1))
    else:k.append(int(k[i]-1))
print(max(k))
s = input()
x, y = map(int,input().split())
flag = 1
X = []
Y = []
cnt = 0
for i in s:
    if i == 'T':
        if flag == 1 and cnt:
            X.append(cnt)
            cnt = 0
        elif flag == -1 and cnt:
            Y.append(cnt)
            cnt = 0
        flag *= -1
    else:
        cnt += 1
if flag == 1 and cnt:
    X.append(cnt)
elif flag == -1 and cnt:
    Y.append(cnt)

dp_x = [[0 for i in range(160001)] for j in range(len(X))]
dp_y = [[0 for i in range(16000)] for j in range(len(Y))]

for i in range(len(X)):
    if i == 0:
        if s[0] == 'T':
            dp_x[0][X[0] + 8000] = 1
            dp_x[0][- X[0] + 8000] = 1
        else:
            dp_x[0][X[0] + 8000] = 1
    else:
        for j in range(16001):
            if dp_x[i-1][j] and 0 <= j + X[i] <= 16000:
                dp_x[i][j + X[i]] = 1
            if dp_x[i-1][j] and 0 <= j - X[i] <= 16000:
                dp_x[i][j - X[i]] = 1

for i in range(len(Y)):
    if i == 0:
        dp_y[0][Y[0] + 8000] = 1
        dp_y[0][- Y[0] + 8000] = 1
    else:
        for j in range(16001):
            if dp_y[i-1][j] and 0 <= j + Y[i] <= 16000:
                dp_y[i][j + Y[i]] = 1
            if dp_y[i-1][j] and 0 <= j - Y[i] <= 16000:
                dp_y[i][j - Y[i]] = 1

if len(X) == 0 and len(Y) == 0:
    if x == 0 and y == 0:
        print('Yes')
    else:
        print('No')
elif len(X) == 0:
    if x == 0 and dp_y[-1][y+8000]:
        print('Yes')
    else:
        print('No')
elif len(Y) == 0:
    if y == 0 and dp_x[-1][x+8000]:
        print('Yes')
    else:
        print('No')
else:
    if dp_y[-1][y+8000] and dp_x[-1][x+8000]:
        print('Yes')
    else:
        print(dp_y[-1][y+8000],dp_x[-1][x+8000])
        print('No')

### FIXED CODE ###

from itertools import product
s = input()
x, y = map(int,input().split())
L = [len(i) for i in s.split('T')]
X = {L[0]}
Y = {0}
for i in L[2::2]:
    X = {j + k for j, k in product(X, [-i, i])}
for i in L[1::2]:
    Y = {j + k for j, k in product(Y, [-i, i])}
if x in X and y in Y:
    print('Yes')
else:
    print('No')
import collections
N = map(int, input().split())
A = list(map(int, input().split()))
Q = map(int, input().split())
 
base = 0
cnt = collections.Counter(A)    
ANS = []
 
for i in range(N):
    base += A[i]

for i in range(Q):
  b,c = map(int, input().split())
  ans = base + (c-b) * cnt[b]
  ANS.append(ans)
  cnt[c] += cnt[b]
  cnt[b] = 0
  base = ans

print(ANS)

### FIXED CODE ###

import collections

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

CNT = collections.Counter(A)
ANS = []
ans = sum(A)

for i in range(q):
    b, c = map(int, input().split())
    t = CNT[b]
    ans +=(c - b) * t
    ANS.append(ans)
    CNT[c] += t
    CNT[b] = 0

for i in ANS:
    print(i)
N, D = map(int,input().split())
a = N//(2D+1)
if N%(2D+1)==0:
  print(a)
else:
  print(a+1)

### FIXED CODE ###

N, D = map(int,input().split())
a = N//(2*D+1)
if N%(2*D+1)==0:
  print(a)
else:
  print(a+1)
import math
r=int(input())
m=float(math.pi)
s=r**2*m
l=2*r*m
print(s,l)

### FIXED CODE ###

import math
r=float(input())
m=float(math.pi)
s=r*r*m
l=2*r*m
print(s,l)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
mod = 10**9 +7
dp = [0]*(N+1)
dp[0] = 1
if A[0]==1:
    dp[1]=0
else:
    dp[1]=1
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])

### FIXED CODE ###

N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
mod = 10**9 +7
dp = [0]*(N+1)
dp[:2]= 1, 1 if 1 not in A else 0
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])
num=int(input())
if num % 2 == 0:
    ans=num/2
else:
    ans=math.floor(num//2)+1
print(int(ans))

### FIXED CODE ###

n = int(input())
print((n+1)//2)
a, b = map(int, input().split())
import math
print(math.ceil(a + b / 2)

### FIXED CODE ###

a, b = map(int, input().split())
import math
print(math.ceil((a + b) / 2))
a = int(input())
b = int(input())

print((a-1)*(b-1))

### FIXED CODE ###

a,b = map(int, input().split())
print((a-1)*(b-1))
n = int(input())
S = input()
letters = list("abcdefghijklmnopqrstuvwxyz")
max([len([x for x in letters if (x in S[:i]) & (x in S[i:])]) for i in range(1, n - 1)])

### FIXED CODE ###

n = int(input())
S = input()
letters = list("abcdefghijklmnopqrstuvwxyz")
print(max([len([x for x in letters if (x in S[:i]) & (x in S[i:])]) for i in range(1, n)]))
N = int(input())
T = [[] for i in range(N+1)]

for i in range(N-1) :
    a,b,c = map(int,input().split())
    T[a].append([b,c])
    T[b].append([a,c])

Q,K = map(int,input().split())

dist = [None]*(N+1)

def dfs(now,d) :
    dist[now] = d
    for to,c in T[now] :
        if dist[to] is not None :
            continue
        dfs(to,d+c)

dfs(K,0)

ans = []

for i in range(Q) :
    u,v = map(int,input().split())
    ans.append(dist[u]+dist[v])

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


### FIXED CODE ###

from collections import deque

N = int(input())

L = [[] for i in range(N)]

for i in range(N-1) :
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    L[a].append([b,c])
    L[b].append([a,c])
    

Q,K = map(int,input().split())

K -= 1

DISTANCE = [float("inf") for i in range(N)]

DISTANCE[K] = 0

q = deque([K])

while q :
    from_ = q.popleft()
    for to_, weight in L[from_] :
        dist = DISTANCE[from_] + weight
        if dist < DISTANCE[to_] :
            DISTANCE[to_] = dist
            q.append(to_)
            
ans = []

for i in range(Q) :
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    
    calc = DISTANCE[x] + DISTANCE[y]
    ans.append(calc)

print(*ans, sep="\n")
n, m = map(int, input().split())

adj = [[] for i in range(n)]

for i in range(m):
    s, t = map(int, input().split())
    adj[s].append(t)
    adj[t].append(s)

isVisited = [False] * n

CC = [None] * n

import sys
sys.setrecursionlimit(1000000000)

def dfs(u, group):
    isVisited[u] = True
    CC[u] = group
    for v in adj[u]:
        if not isVisited[v]:
            dfs(v, group)

def makeCC(group):
    for i in range(n):
        if not isVisited[i]:
            dfs(i, group)
            group += 1

def isConnected(v1, v2):
    if CC[v1] == CC[v2]:
        print('yes')
    else:
        print('no')


makeCC(0)


q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    isConnected(s, t)

### FIXED CODE ###

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

adj = [[] for i in range(n)]

for i in range(m):
    s, t = map(int, input().split())
    adj[s].append(t)
    adj[t].append(s)

groups = [None] * n


def dfs(u, group_num):
    path = []
    path.append(u)
    groups[u] = group_num
    while path:
        u = path[-1]
        if adj[u]:
            v = adj[u].pop(0)
            if not groups[v]:
                groups[v] = group_num
                path.append(v)
        else:
            path.pop()


g_n = 1
for i in range(n):
    if not groups[i]:
        dfs(i, g_n)
        g_n += 1

def isConnected(v1, v2):
    if groups[v1] == groups[v2]:
        print('yes')
    else:
        print('no')


q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    isConnected(s, t)
s = input()
k = int(input())

ns = []
for c in s[:-1]:
    ofstoa = ord('z')+1-ord(c)
    if k >= ofstoa:
        ns.append('a')
        k -= ofstoa
    else:
        ns.append(c)

last = ord(s[-1])
if last + k > ord('z'):
    ns.append(chr(last + k - 26))
else:
    ns.append(chr(last + k))

print(''.join(ns))

### FIXED CODE ###

s = input()
k = int(input())

ns = []
for c in s[:-1]:
    if c == 'a':
        ns.append(c)
        continue

    ofstoa = ord('z')+1-ord(c)
    if k >= ofstoa:
        ns.append(chr(ord(c) + ofstoa - 26))
        k -= ofstoa
    else:
        ns.append(c)

last = ord(s[-1])
k = k%26
if last + k > ord('z'):
    ns.append(chr(last + k - 26))
else:
    ns.append(chr(last + k))
print(''.join(ns))
import numpy as np


def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


mod = 10 ** 9 + 7  # 出力の制限
N = 10 ** 4
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


n = int(input())
arr = list(map(int,input().split()))
arr = np.array(arr)
A = np.zeros((n,n))

for i in range(n):
    A[i][i] = 0.5
    A[i][i-1] = 0.5

ans = np.linalg.solve(A, arr)

for i in range(n-1):
    print(int(ans[i-1]),end=" ")

print(int(ans[n-1]))





### FIXED CODE ###

import numpy as np





n = int(input())
arr = list(map(int,input().split()))


#
# if n <= 3:
#     ans = np.linalg.solve(A, arr)
#
#     for i in range(n - 1):
#         print(int(ans[i]), end=" ")
#
#     print(int(ans[n - 1]))
# else:

odd = 0
eq = 0
all = [0,0]

for i in range(n):
    if i % 2 == 0:
        eq += arr[i]
        all.append(eq)
    else:
        odd += arr[i]
        all.append(odd)


ans = [0 for i in range(n)]

base = eq-odd
base2 = odd-eq+2*arr[0]
for i in range(n):
    if i %2 ==  0:
        ans[i] = base
        if i == n-1:
            break
        base -= 2*arr[i]
        base += 2* arr[i+1]


    if i %2 ==  1:
        ans[i] =base2
        base2 -= 2*arr[i]
        base2 += 2*arr[i+1]



for i in range(n-1):
    print(ans[i],end=" ")
print(ans[-1])
from functools import lru_cache
@lru_cache(maxsize=None)
def fac(n, mod = 10**9+7):
    if n == 0:
        return 1
    else:
        return fac(n-1) * n % mod

n = int(input())
print(fac(n))

### FIXED CODE ###

n = int(input())
mod = 10**9 + 7
ans = 1
for i in range(1, n+1):
    ans *= i
    ans %= mod

print(ans)
# -*- coding: utf-8 -*-
import numpy as np

inputs = input().split(' ')
N = int(inputs[0])
M = int(inputs[1])
cards = input().split(' ')
cards = [int(x) for x in cards]
cards.sort()

BC = []
for _ in range(M):
    inputs = input().split(' ')
    inputs = [int(x) for x in inputs]
    BC.append(inputs)

idx = 0
BC = np.sort(BC, axis=0)[::-1]
for bc in BC:
    print(cards)
    if idx >= N:
        break
    for _ in range(bc[0]):
        c = bc[1]
        if cards[idx] >= c:
            break
        else:
            cards[idx] = c
            idx += 1
            if idx >= N:
                break

print(sum(cards))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np

inputs = input().split(' ')
N = int(inputs[0])
M = int(inputs[1])
cards = input().split(' ')
cards = [int(x) for x in cards]
cards.sort()

BC = []
for _ in range(M):
    inputs = input().split(' ')
    inputs = [int(x) for x in inputs]
    BC.append({'B': inputs[0], 'C': inputs[1]})

idx = 0
BC.sort(key=lambda x: x['C'], reverse=True)
for bc in BC:
    if idx >= N:
        break
    for _ in range(bc['B']):
        c = bc['C']
        if cards[idx] >= c:
            break
        else:
            cards[idx] = c
            idx += 1
            if idx >= N:
                break

print(sum(cards))
a=map(int,raw_input().split())
a.sort()
while a[1]%a[0]!=0:
 a[0],a[1]=a[1]%a[0],a[0]
return a[0]

### FIXED CODE ###

a=map(int,raw_input().split())
a.sort()
while a[1]%a[0]!=0:
 a[0],a[1]=a[1]%a[0],a[0]
print(a[0])
import numpy
def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ?????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ????????????§?????????????????????-> ??°?????????????????????¶???????????????????
    3. 2?????????????????????°?????????????????????????????????????????????
    """
    # 1.
    coin_values=np.array(coin_values)
    coin_nums=np.array(coin_nums)
    all = np.dot(coin_values, coin_nums)
    oturi = int(all - fee)

    use_coins = [0] * len(coin_values)
    no_use_coins = [0] * len(coin_values)
 
    # 2.
    for i in range(len(coin_values) - 1, -1, -1):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])
 
    # 3.
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))
 
if __name__ == "__main__":
    first = True
    while (True):
        total_fee = int(input(''))
        if total_fee == 0:
            break
        if first:
            first = False
        else:
            print('')
        coins = input('')
        coins = coins.split(' ')  # 10, 50, 100, 500?????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values = [10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)

### FIXED CODE ###

import math
def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ?????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ????????????§?????????????????????-> ??°?????????????????????¶???????????????????
    3. 2?????????????????????°?????????????????????????????????????????????
    """
    # 1.
    oturi = coin_values[0] * coin_nums[0] \
            + coin_values[1] * coin_nums[1] \
            + coin_values[2] * coin_nums[2] \
            + coin_values[3] * coin_nums[3] \
            - fee

    use_coins = [0] * len(coin_values)
    no_use_coins = [0] * len(coin_values)
 
    # 2.
    for i in range(len(coin_values) - 1, -1, -1):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])
 
    # 3.
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))
 
if __name__ == "__main__":
    first = True
    while (True):
        total_fee = int(input(''))
        if total_fee == 0:
            break
        if first:
            first = False
        else:
            print('')
        coins = input('')
        coins = coins.split(' ')  # 10, 50, 100, 500?????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values = [10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)
S=input()
A=int(S[0])
B=int(S[1])
C=int(S[2])
D=int(S[3])

op = ["+","-"]

for i in op:
  for j in op:
    for k in op:
      if eval("A {} B {} C {} D".format(i, j, k)) == 7:
        print("{}{}{}{}{}{}{}{}{}".format(A, i, B, j, C, k, D))
        exit()

### FIXED CODE ###

S=input()
A=int(S[0])
B=int(S[1])
C=int(S[2])
D=int(S[3])

op = ["+","-"]

for i in op:
  for j in op:
    for k in op:
      if eval("A {} B {} C {} D".format(i, j, k)) == 7:
        print("{}{}{}{}{}{}{}=7".format(A, i, B, j, C, k, D))
        exit()
from itertools import product

N = int(input())
ans = 0
for i in product("357", repeat=N):
    x = "".join(i)
    if 357 <= int(x) <= N and len(set(x)) = 3:
        ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
def dfs(s):
    if int(s) > N:
        return 0
    else:
        if '7' in s and '5' in s and '3' in s:
            ret = 1
        else:
            ret = 0
        for i in '357':
            ret += dfs(s + i)
        return ret
print(dfs("0"))
from sys import stdin
a = map(int,stdin.readline().split())
a.sort()
print a[0] + a[[1]

### FIXED CODE ###

from sys import stdin
a = map(int,stdin.readline().split())
a.sort()
print a[0] + a[1]
s=input()
print(2*(min(s.count("0"),s.count("1")))


### FIXED CODE ###

s=input()
print(2*(min(s.count("0"),s.count("1"))))
N = int(raw_input())
ans = 1000000
for A in range(1, 1+N/2):
  B = N - A
  a = 0
  b = 0
  for i in range(6)[::-1]:
    ta = tA/10**i
    tb = tB/10**i
    a += ta
    b += tb
    A -= ta*(10**i)
    B -= tb*(10**i)
  ans = min(ans, a+b)
print ans


### FIXED CODE ###

N = int(raw_input())
ans = 1000000
for A in range(1, 1+N/2):
  B = N - A
  a = 0
  b = 0
  tA = A
  tB = B
  for i in range(6)[::-1]:
    ta = tA/10**i
    tb = tB/10**i
    a += ta
    b += tb
    tA -= ta*(10**i)
    tB -= tb*(10**i)
  ans = min(ans, a+b)
print ans
import math
Q = int(input())

def sosuu(x):
  if x == 1:
    return False
  else:
    for i in range(1,int(math.sqrt(x))):
      if x % (i+1) == 0:
        return False
    return True

table=[0]*50001
for i in range(1,50001):
  if i%2==1 and sosuu((i+1)//2) and sosuu(i):
    table[i]=table[i-1] + 1
  else:
    table[i]=table[i-1]
#print(table[0:10])
ans=[0]*Q
for i in range(Q):
  l,r=map(int,input().split())
  ans[i]=table[r] - table[l-1]
  
for i in range(Q):
  print(ans[i])
 

### FIXED CODE ###

import math
Q = int(input())

def sosuu(x):
  if x == 1:
    return False
  else:
    for i in range(1,int(math.sqrt(x))):
      if x % (i+1) == 0:
        return False
    return True

table=[0]*100001
for i in range(1,100001):
  if i%2==1 and sosuu(int((i+1)/2)) and sosuu(i):
    table[i]=table[i-1] + 1
  else:
    table[i]=table[i-1]
#print(table[0:10])
ans=[0]*Q
for i in range(Q):
  l,r=map(int,input().split())
  ans[i]=table[r] - table[l-1]
  
for i in range(Q):
  print(ans[i])
n = input()
a = [bin(int(x))[2:] for x in input().split()]
a = [len(x) - (x.rfind('1') + 1) for x in a]
print(min(a))

### FIXED CODE ###

print(input().count('1'))
# https://img.atcoder.jp/abc131/editorial.pdf

import sys

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

# n個の頂点から2つ選ぶ組み合わせ
comb = n*(n-1)/2

v = comb - (n-1)

# そのうちn-1組は距離１なので...
if k > v:
    print(-1)
    sys.exit()

# それ以外の場合(k <= comb - (n-1))は必ず解がある
# 「うに」を考える

add_edge = v - k

m = n - 1 + add_edge
print(m)

# まずはうにの辺を出力（n-1本）, １はうにの中心
for i in range(n-1):
    print(1, 2+i)

# その後 add_edgeを出力
for i in range(add_edge):
    start = 2*i + 2
    end = start+1
    print(start, end)


### FIXED CODE ###

# https://img.atcoder.jp/abc131/editorial.pdf

import sys

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

maxPossible = (n-2) * (n-1) // 2

if k > maxPossible:
    print(-1)
    sys.exit()
ret = []

# うに(1が中心)
for i in range(2, n+1):
    ret.append((1, i))

# maxPossible - k 個の辺を追加
count = 0
for i in range(2, n+1):
    if count == maxPossible - k:
        break
    for j in range(i+1, n+1):
        ret.append((i, j))
        count += 1
        if count == maxPossible - k:
            break

print(len(ret))
for u, v in ret:
    print(u, v)
import numpy as np
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_array = np.array(A)
B_array = np.array(B)
A_cum = np.cumsum(A_array)
B_cum = np.cumsum(B_array)
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    a = 0
    b = len(B_cum)-1
    print(B_check)
    while b - a != 0:
        c = round((a+b)/2)
        if B_check[c] < 0:
            b = c
        else:
            a = c
        if b-a == 1:
            if B_check[b] < 0:
                b = a
            else:
                a = b
    check = i+b+2
    if check>ans:
        ans = check
print(ans)

### FIXED CODE ###

import bisect
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
A_cum = [0]
B_cum = [0]
A_cum[0] = A[0]
for j in range(len(A)-1):
    A_cum.append(A_cum[j]+ A[j+1])
B_cum[0] = B[0]
for l in range(len(B)-1):
    B_cum.append(B_cum[l] + B[l+1])
for i in range(len(A_cum)):
    k = A_cum[i]
    if k >K:
        break
    b = bisect.bisect(B_cum,K-k)
    check = i+b+1
    if check>ans:
        ans = check
check = bisect.bisect(B_cum,K)
if check>ans:
    ans = check    
print(ans)
n = int(raw_input())
S = map(int, raw_input().split(' '))
q = int(raw_input())
T = map(int, raw_input().split(' '))

def search(S,k):
    for s in S:
        if s == k:
            return True
    return False

c = 0
for t in T:
    if search(S,t): c += 1

print c

### FIXED CODE ###

def search(S,t):
    for s in S:
        if t == s:
            return True
    return False

n = int(raw_input())
S = map(int,raw_input().split(' '))
q = int(raw_input())
T = map(int,raw_input().split(' '))


ret = 0
for t in T:
    if search(S,t):
        ret += 1
print ret
from bisect import*
n,k,*a=map(int,open(0).read().split())
b=[[]for _ in range(n+1)]
for i,v in enumerate(a):b[v]+=i,
s=a[0]
i=c=0
while 1:
  t=b[s]
  m=len(t)
  j=bisect(t,i)
  c+=j==m
  i=t[j%m]+1
  if i==n:break
  s=a[i]
k%=c+1
s=[]
for i in a*k:
  if i in s:s=s[:s.index(i)]
  else:s+=i,
print(*s)

### FIXED CODE ###

from bisect import*
from collections import*
n,k,*a=map(int,open(0).read().split())
b=defaultdict(list)
for i,v in enumerate(a):b[v]+=i,
s=a[0]
i=c=0
while 1:
  t=b[s]
  m=len(t)
  j=bisect(t,i)
  c+=j==m
  i=t[j%m]+1
  if i==n:break
  s=a[i]
k%=c+1
s=a[0]
i=c=0
while c<k-1:
  t=b[s]
  m=len(t)
  j=bisect(t,i)
  c+=j==m
  i=t[j%m]+1
  s=a[i]
r=[]
while 1:
  t=b[s]
  m=len(t)
  j=bisect(t,i)
  if j==m:
    r+=s,
    i+=1
  else:
    i=t[j]+1
  if i==n:
    break
  s=a[i]
print(*r)
import sys
sys.setrecursionlimit(500*500)
S = input()
T =input()
s = S.lower()
t = T.lower()
if len(s) or len(t) > 100 : 
    print("error")
print(T + S)

### FIXED CODE ###

S, T = input().split()

print(T + S)