Harryxun/stf_run huggingface dataset:
n,g,s = map(int,input().split())
G = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  G[a-1].append(b-1)
  G[b-1].append(a-1)
  
def dfs(V,v,d):
  if V[v] != -1:
    return
  V[v] = d
  for nv in G[v]:
    dfs(V,nv,d+1)
  
if len(G[g-1])==1 and G[g-1][0]==s-1:
  print(0)
else:
  vs = [-1]*n
  vg = [-1]*n
  dfs(vs,s-1,0)
  dfs(vg,g-1,0)
  
  ans = 0
  for i in range(n):
    if vs[i]>vg[i]:
      ans = max(ans,vs[i])
      
  print(ans-1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n,g,s = map(int,input().split())
G = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  G[a-1].append(b-1)
  G[b-1].append(a-1)
  
def dfs(V,v,d):
  if V[v] != -1:
    return
  V[v] = d
  for nv in G[v]:
    dfs(V,nv,d+1)
  
if len(G[g-1])==1 and G[g-1][0]==s-1:
  print(0)
else:
  vs = [-1]*n
  vg = [-1]*n
  dfs(vs,s-1,0)
  dfs(vg,g-1,0)
  
  ans = 0
  for i in range(n):
    if vs[i]>vg[i]:
      ans = max(ans,vs[i])
      
  print(ans-1)
n = int(raw_input())
if n == 1:
    print("Hello World")
elif n == 2:
	a = int(raw_input())
    b = int(raw_input())
    print a + b

### FIXED CODE ###

N = input()
if N == 1:
    print "Hello World"
else:
    A = input()
    B = input()
    print A+B
n = int(input())
if n==1:
  print(0)
else:
  cnt = 0
  flg = 0
  for i in range(1000000):
    if n<i:
      break
    if i==0 or i==1 or n%i!=0:
      continue
    j = i
    while(n%j==0):
      if flg==0:
        flg = 1
      n /= j
      j *= i
      cnt += 1
  if flg==0:
    print(1)
  else:
    print(cnt)

### FIXED CODE ###

from decimal import Decimal as dc
a,b = map(dc, input().split())
print(int(a*b))
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
S = input()
T = input()
L = N*M//gcd(N, M)
X = [""]*L

for i, s in enumerate(S):
	X[i*(L//N)] = s

for i, t in enumerate(T):
	if X[i*(L//M)] and X[i*(L//M)] != t:
		print(-1)
		break
else:
	print(L)


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
S = input()
T = input()
L = N*M//gcd(N, M)
g = gcd(N, M)
for i in range(g):
	if S[N//g*i] != T[M//g*i]:
		print(-1)
		break
else:
	print(L)
n = int(input())
As = [int(input()) for _ in range(n)]
visited = [-1 for i in range(n)]


def rec(visited, i, depth):
    # print(i, visited[i])
    if visited[i] > 0:
        return visited[i]
    elif visited[i] == 0:
        return -1
    if As[i] == 2:
        visited[i] = 1
        return depth
    visited[i] = 0
    visited[i] = rec(visited, As[i] - 1, depth + 1)
    return visited[i]


ret = rec(visited, 1 - 1, 1)
print(ret)



### FIXED CODE ###

n = int(input())
As = [int(input()) for _ in range(n)]
cnt = 0
current_button = 0
for _ in range(n):
    current_button = As[current_button] - 1
    cnt += 1
    if current_button == 1:
        break
if current_button != 1:
    print(-1)
else:
    print(cnt)
n,a,b,c,d = map(int, input().split())
​
s = input()
​
​
#すぬけ君のゴールがふぬけ君より右にある場合
if c > d:
  #ゴールより左かつふぬけ君の右に岩のない部分が3つ連続していれば、すぬけ君はふぬけ君を追い越すことができる
  if s[a:].count("##") == 0:
    if s[b-1:d+1].count("...") >= 1:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  if s[a:].count("##") == 0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n,a,b,c,d = map(int, input().split())
a -= 1
b -= 1
s = input()
ans = "No"
snk = s[a:c].count("##")
fnk = s[b:d].count("##")
if snk == 0 and fnk == 0:
  if c > d:
    if s[b-1:d+1].count("...") >= 1:
      ans = "Yes"
  else:
    ans = "Yes"
    
print(ans)
allist = []
for i in range(6):
    num = int(input())
    if i == 5:
        k = num
    else:
        alllist.append(num)

diflist = []
for i in range(4):
    diflist.append(alllist[i+1]-alllist[i])

for i in diflist:
    if i > k:
        print(":(")
        break
else:
    print("Yay!")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e-a>k:
    print(":(")
else:
    print("Yay!")
object Main extends App {
  val r = scala.io.StdIn.readInt
  println(r * r * 3)
}


### FIXED CODE ###

r = int(input())

print(3 * r * r)
n, m = map(int, input().split())
lis = [list(input().split()) for _ in range(m)]
d = {}
ac, wa = 0, 0
for i in lis:
    if i[0] not in d:
        if i[1] == 'AC':
            ac += 1
            d[i[0]] = 'AC'
        else:
            d[i[0]] = 1
    else:
        if i[1] == 'AC':
            if d[i[0]] != 'AC':
                ac += 1
                wa += d[i[0]]
                d[i[0]] = 'AC'
        else:
            d[i[0]] += 1
print(ac, wa)

### FIXED CODE ###

n, m = map(int, input().split())
lis = [list(input().split()) for _ in range(m)]
d = {}
ac, wa = 0, 0
for i in lis:
    if i[0] not in d:
        if i[1] == 'AC':
            ac += 1
            d[i[0]] = 'AC'
        else:
            d[i[0]] = 1
    else:
        if i[1] == 'AC':
            if d[i[0]] != 'AC':
                ac += 1
                wa += d[i[0]]
                d[i[0]] = 'AC'
        else:
            if d[i[0]] != 'AC':
                d[i[0]] += 1
print(ac, wa)
#50b
#n　問題数
n = int(input())
#t 時間
t = [int(i) for i in input().split()]
#m ドリンクの種類
m = int(input())
ans = []
for i in range(m):
    a,b = map(int,input().split())
    temp = sum(t) - t[a-1] + b
    ans[i] = temp
for i in range(m):
    print(ans[i])

### FIXED CODE ###

#50b
#n　問題数
n = int(input())
#t 時間
t = [int(i) for i in input().split()]
#m ドリンクの種類
m = int(input())
ans = []

for i in range(m):
    a,b = map(int,input().split())
    temp = sum(t) - t[a-1] + b
    ans.append(temp)

for i in range(m):
    print(ans[i])
def main():
    m, k = map(int, input().split())
    maximum = 2 ** m - 1

    if k==0:
        print(" ".join(map(str, range(0, maximum+1))), end=" ")
        print(" ".join(map(str, range(maximum, -1, -1))))
        return

    if m==1:
        print(-1)
        return

    if maximum < k:
        print(-1)
        return

    other_than_k = [i for i in range(1, maximum+1) if i!=k]
    print(" ".join(map(str, other_than_k[2:])), end=" ")
    print(other_than_k[0], k, other_than_k[0], other_than_k[1], k, other_than_k[1], end=" ")
    print(" ".join(reversed(map(str, other_than_k[2:]))))

main()

### FIXED CODE ###

def main():
    m, k = map(int, input().split())
    maximum = 2 ** m - 1

    if k==0:
        print(" ".join(map(str, range(0, maximum+1))), end=" ")
        print(" ".join(map(str, range(maximum, -1, -1))))
        return

    if m==1:
        print(-1)
        return

    if maximum < k:
        print(-1)
        return

    others = [i for i in range(1, maximum+1) if i!=k]
    print(0, k, 0, end=" ")
    print(" ".join(map(str, others)), k, " ".join(map(str, reversed(others))))


main()
'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''
n , m = map(int,input().split())
dp = [-1 for _ in range(n)]
flag = True 
for _ in range(m):
	i , val =  map(int,input().split())
	if dp[i-1] == -1:
		dp[i-1]=val
	elif dp[i-1]!=val:
		flag = False
		# print(dp[i-1])
		break
if dp[0]==0:
	flag = False
if flag:
	for i in range(n):
		if dp[i]==-1:
			dp[i]=0
	if dp[0]==0:
		dp[0]=1
	for x in dp:
		print(str(x),end="")
else:
	print("-1")

### FIXED CODE ###

'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''
grid = []
for _ in range(3):
	temp = []
	temp = list(map(int,input().split()))
	grid.append(temp)
N = int(input())
b = []
for _ in range(N):
	b.append(int(input()))
for x in b:
	for i in range(3):
		for j in range(3):
			if grid[i][j]==x:
				grid[i][j]= -(grid[i][j])
ans = -1
# if not (grid[0][0]<0 and grid[1][1]<0 and grid[2][2]<0):	
for i in range(3):
	if grid[i][0]<0 and grid[i][1]<0 and grid[i][2]<0:
		ans  = 1
		break
	elif(grid[0][i]<0 and grid[1][i]<0 and grid[2][i]<0):
		ans = 1
		break
if ans!=1:
	if (grid[0][0]<0 and grid[1][1]<0 and grid[2][2]<0):
		ans = 1
	if( grid[0][2]<0 and grid[1][1]<0 and grid[2][0]<0):
		ans =1  
if(ans ==1):
	print("Yes")
else:
	print("No")
N,Q=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N-1)]
B=[list(map(int,input().split())) for i in range(Q)]
#行先
C=[[]*i for i in range(N)]
#合計値
D=[0]*N

for i in range(N-1):
  C[A[i][0]-1].append(A[i][1])

def f(a,b):
  D[a-1]+=b
  x=len(C[a-1])
  if x>0:
    for k in range(x):
      f(C[a-1][k],b)

for l in range(Q):
  f(B[l][0],B[l][1]) 
  
print(*D)  

### FIXED CODE ###

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

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

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

used = [False] * N
r = [0] * N

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

stack = [0]
while stack:
  i = stack.pop()
  used[i] = True
  for to in l[i]:
    if not used[to]:
      stack.append(to)
      r[to] += r[i]

print(*r)
def main():
    import bisect
    import sys
    from itertools import accumulate
    input = sys.stdin.readline
    def hsnum(ls,x):
        num = 0
        for i in range(n):
            y = x-ls[i]
            num += n-bisect.bisect_left(ls,y)
        return num
    n,m = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    suma = [0]+list(accumulate(a))
    lx = 0
    rx = 2*10**5+2
    error = 0
    while lx < rx:
        mx = (lx+rx)//2
        if hsnum(a,mx) < m:
            rx = mx
        elif hsnum(a,mx) > m:
            if hsnum(a,mx+1) < m:
                error = hsnum(a,mx)-m
                lx = mx
                break
            lx = mx + 1
        else:
            lx = mx
            break
    ans = 0
    for i in range(n):
        rema = lx - a[i]
        j = bisect.bisect_left(a,rema)
        ans += (n-j)*a[i]+suma[n]-suma[j]
    print(ans-error*lx)
if __name__ == "__main__":
    main()

### FIXED CODE ###

s,t=input().split()
print(t+s)
import collections

n = int(input())
A = map(int, input().split())
c = collections.Counter(A)
if n % 2 == 0:
    for k, v in c.items():
        if v % 2 != 0:
            print(0)
            break
    else:
        print(int((2 ** (n / 2)) % (10 ** 9 + 7)))
else:
    if c[0] != 1:
        print(0)
    else:
        for k, v in c.items():
            if v % 2 != 0 and k != 0:
                print(0)
                break
        else:
            print(int((2 ** ((n - 1) / 2)) % (10 ** 9 + 7)))


### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
if n % 2 == 0:
    l = n ** 2
else:
    l = (n - 1) * (n + 1)
if sum(A) == l // 2:
    print(2 ** (n // 2) % (10 ** 9 + 7))
else:
    print(0)
h,a = map(int,input().split())
print(h//a + (h%a>0)

### FIXED CODE ###

h,a = map(int,input().split())
print(h//a + (h%a>0))
h, w = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(h)]

count = 0
ans = []
for i in range(0, h-1, 2):
    for j in range(w):
        if lst[i][j] % 2 == 1:
            count += 1
            if j == w-1:
                lst[i+i][j] += 1
                ans.append((i+1, j+1, i+2, j+1))
            else:
                lst[i][j+1] += 1
                ans.append((i+1, j+1, i+1, j+2))
    for j in reversed(range(w)):
        if lst[i+1][j] % 2 == 1:
            if j == 0 and i == h-1:
                pass
            elif j == 0:
                lst[i+2][j] += 1
                ans.append((i+2, j+1, i+3, j+1))
                count += 1
            else:
                lst[i][j-1] += 1
                ans.append((i+2, j+1, i+2, j))
                count += 1
if h % 2 == 1:
    for j in range(w):
        if lst[-1][j] % 2 == 1:
            if j == w-1:
                pass
            else:
                lst[i][j+1] += 1
                ans.append((i+1, j+1, i+1, j+2))
                count += 1
                
print(count)
for a,b,c,d in ans:
    print(a,b,c,d)

### FIXED CODE ###

h, w = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(h)]

count = 0
ans = []
for i in range(0, h-1, 2):
    for j in range(w):
        if lst[i][j] % 2 == 1:
            count += 1
            if j == w-1:
                lst[i+1][j] += 1
                ans.append((i+1, j+1, i+2, j+1))
            else:
                lst[i][j+1] += 1
                ans.append((i+1, j+1, i+1, j+2))
    for j in reversed(range(w)):
        if lst[i+1][j] % 2 == 1:
            if j == 0 and i+1 == h-1:
                pass
            elif j == 0:
                lst[i+2][j] += 1
                ans.append((i+2, j+1, i+3, j+1))
                count += 1
            else:
                lst[i+1][j-1] += 1
                ans.append((i+2, j+1, i+2, j))
                count += 1
if h % 2 == 1:
    for j in range(w):
        if lst[-1][j] % 2 == 1:
            if j == w-1:
                pass
            else:
                lst[-1][j+1] += 1
                ans.append((h, j+1, h, j+2))
                count += 1
                
print(count)
for a,b,c,d in ans:
    print(a,b,c,d)
N = int(raw_input())
num_list = map(int, raw_input().split())

c = 0
flag = 1
while flag==1:
    flag =0
    for j in range(N-1,0,-1):
        if num_list[j] < num_list[j-1]:
            a = num_list[j]
            num_list[j] = numlist[j-1]
            num_list[j-1] = a
            c += 1
            flag =1
print " ".join(map(str,num_list))
print c

### FIXED CODE ###

N = int(raw_input())
num_list = map(int, raw_input().split())

c = 0
flag = 1
while flag==1:
    flag =0
    for j in range(N-1,0,-1):
        if num_list[j] < num_list[j-1]:
            a = num_list[j]
            num_list[j] = num_list[j-1]
            num_list[j-1] = a
            c += 1
            flag =1

print " ".join(map(str,num_list))
print c
a,b=map(int,input().split())
print(max(2*a-1,2*b-1,a+b)

### FIXED CODE ###

a,b=map(int,input().split())
k=0
for i in range(2):
  if a>b:
    k=k+a
    a-=1
  else:
    k=k+b
    b-=1
print(k)
from scipy.misc import comb

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

for i in range(k):
    print(int(comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))

### FIXED CODE ###

def factorial_mod(n, mod):
    a = 1
    for i in range(1, n + 1):
        a *= i
        a %= mod
    return a


def cmb(n, k, mod):
    if k > n or k < 0:
        return 0
    fact_n = factorial_mod(n, mod)
    fact_k = factorial_mod(k, mod)
    fact_n_k = factorial_mod(n - k, mod)
    return (fact_n * pow(fact_k, mod - 2, mod) * pow(fact_n_k, mod - 2, mod)) % mod


n, k = map(int, input().split())
MOD = 10**9 + 7

for i in range(k):
    print(int(cmb(n - k + 1, i + 1, MOD) * cmb(k - 1, i, MOD) % MOD))
N,M=int(input().split())

if N==M:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

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

if N==M:
  print("Yes")
else:
  print("No")
n = int(input())
h = list(map(int, input().split()))
l = []
cnt = 0
ans = 0
for i in reversed(range(1, n)):
  if h[i]<=h[i-1]:
    cnt += 1
  else:
    l.append(cnt)
    cnt = 0
ans = max(l)
print(ans)

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
l = []
cnt = 0
ans = 0
for i in reversed(range(1, n)):
  if h[i]<=h[i-1]:
    cnt += 1
  else:
    l.append(cnt)
    cnt = 0
  if i==1:
    l.append(cnt)

if len(l)!=0: ans = max(l)
print(ans)
N = input()
for i in range(len(N)):
    if N[i] = '7':
        print('Yes')
        break
else:
    print('No')

### FIXED CODE ###

N = input()
for i in range(len(N)):
    if N[i] == '7':
        print('Yes')
        break
else:
    print('No')
def main():
 a,b,c,d = map(int,input().split())
 if abs(a - c) <= d or abs(a - b) + abs(b - c) <= d:
main()

### FIXED CODE ###

def main():
 a,b,c,d = map(int,input().split())
 if abs(a - c) <= d or (abs(a - b) <= d and abs(b - c) <= d):
     print('Yes')
 else:
     print('No')
main()
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline


def f(a):
    for i in range(n-1):
        b[i] = a[i] % a[i+1]
    return b


n, *a = map(int, read().split())

b = [0] * n

a = sorted(a, reverse=True)
z = 0

while a[len(a)] == 0:
    a = f(a)
    z += 1

print(z-1)


### FIXED CODE ###

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

n = int(readline())
a = np.array(read().split(), np.int32)

b = np.zeros(10**6 + 10, np.int32)
cnt = 0

for x in a:
    if b[x] > 1:
        continue
    b[::x] += 1

for x in a:
    if b[x] == 1:
        cnt += 1

print(cnt)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
def main():
    N = int(input())
    S = input().rstrip("\r\n")
    R = []
    G = []
    B = []
    for i, s in enumerate(S):
        if s == "R":
            R.append(i)
        elif s == "G":
            G.append(i)
        else:
            B.append(i)
    ans = len(R) * len(G) * len(B)
    for i in range(len(R)):
        for j in range(len(G)):
            diff = G[j] - R[i]
            left = 0
            right = len(B)
            exists_same = False
            while left < right:
                m = (left + right) // 2
                if B[m] - G[j] == diff:
                    exists_same = True
                    break
                elif B[m] - G[j] > diff:
                    right = m
                elif B[m] - G[j] < diff:
                    left = m + 1
            if exists_same:
                ans -= 1
    for i in range(len(R)):
        for j in range(len(B)):
            diff = B[j] - R[i]
            left = 0
            right = len(G)
            exists_same = False
            while left < right:
                m = (left + right) // 2
                if G[m] - B[j] == diff:
                    exists_same = True
                    break
                elif G[m] - B[j] > diff:
                    right = m
                elif G[m] - B[j] < diff:
                    left = m + 1
            if exists_same:
                ans -= 1
    for i in range(len(B)):
        for j in range(len(G)):
            diff = B[j] - R[i]
            left = 0
            right = len(R)
            exists_same = False
            while left < right:
                m = (left + right) // 2
                if R[m] - B[j] == diff:
                    exists_same = True
                    break
                elif R[m] - B[j] > diff:
                    right = m
                elif R[m] - B[j] < diff:
                    left = m + 1
            if exists_same:
                ans -= 1
    print(ans)
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
def main():
    N = int(input())
    S = input().rstrip("\r\n")
    R = []
    G = []
    B = []
    for i, s in enumerate(S):
        if s == "R":
            R.append(i)
        elif s == "G":
            G.append(i)
        else:
            B.append(i)
    ans = len(R) * len(G) * len(B)
    for i in range(N):
        for j in range(i+1, N):
            k = 2 * j - i
            if k >= N:continue
            if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
                ans -= 1
    print(ans)
if __name__ == "__main__":
    main()
from collections import Counter
print 'Yes' if all(v % 2 == 0 for v in Counter(raw_input()).values())) else 'No'

### FIXED CODE ###

from collections import Counter
print 'Yes' if all(a%2-1 for a in Counter(raw_input()).values()) else 'No'
a, b, c = map(int, input().split())
ig a + b + c >= 22:
  print("bust")
else:
  print("win")

### FIXED CODE ###

a, b, c = map(int, input().split())
if a + b + c >= 22:
  print("bust")
else:
  print("win")
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      elif l[i]+l[j]>l[-1]:
        ans+=n-j-1
        break
      if l[i]+l[j]<=l[k] :
        ans+=k-j-1
        ans1+=k-j-1
        break
      
      
print(ans)
      
        
        


### FIXED CODE ###

n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
ans1=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+ans1,n):
      ans1=0
      if l[i]+l[j]>l[-1]:
        ans+=n-j-1
        break
      elif l[i]+l[j]<=l[k] :
        ans+=k-j-1
        ans1+=k-j-1
        break
      
      
print(ans)
the_string = input()
a,b,c = the_string.split()
for i in range(c):
    while(a!=0):
        a-1
    b-1

### FIXED CODE ###

cookies = [int(x) for x in input().split()]
leftOver = cookies[0] - cookies[2]
takahashi = max(0, leftOver)
print(str(takahashi)+ ' ' + (str(cookies[1]) if takahashi > 0  else str(max(0,cookies[1] - abs(leftOver)))))
from bisect import bisect_left

n = int(input())
ls = list(map(int, input().split())).sort()
count = 0
for i in range(n - 2):
  for j in range(i + 1, n - 1):
    two_sides_sum = ls[i] + ls[j]
    bi = bisect_left(ls, two_sides_sum)
    count += bi - j - 1
print(count)

### FIXED CODE ###

import bisect
n = int(input())

li = list(map(int, input().split()))
li.sort()

count = 0

for i in range(n - 2):
  for j in range(i + 1, n - 1):
    bi = bisect.bisect_left(li, li[i] + li[j])
    count += bi - j - 1
print(count)
#-*- coding:utf-8 -*-
import math
import sys

t,x,y = [],[],[]
N = int(input())

for i in range(N):
	a, b, c = map(int, input().split())
	t.append(a)
	x.append(b)
	y.append(c)

for i in range(N):
	T = t[i+1]-t[i]
	Z = abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
	if (T < Z) or ((T%2) != (Z%2)):
		print("No")
		sys.exit()
print("Yes")


### FIXED CODE ###

#-*- coding:utf-8 -*-
import math
import sys

t,x,y = [],[],[]
N = int(input())

t.append(0)
x.append(0)
y.append(0)

for i in range(N):
	a, b, c = map(int, input().split())
	t.append(a)
	x.append(b)
	y.append(c)

for i in range(N):
	T = t[i+1]-t[i]
	Z = abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
	if (T < Z) or ((T%2) != (Z%2)):
		print("No")
		sys.exit()
print("Yes")
A, B = map(int, input().split())

s = 1 + 2 + 3
print('{}'.format(s-A-B))


### FIXED CODE ###

A = int(input())
B = int(input())
s = 1 + 2 + 3
print '{}'.format(s-A-B)