Harryxun/stf_run huggingface dataset:
x1,y1,x2,y2 = map(int,input().split())
x3 = x2+y1-y2
y3 = -x1+x2+y2
x4 = x1+y1-y2
y4 = -x1+x2+y1
print(x3,y3,x4,y4)

### FIXED CODE ###

k = int(input())
m = (k-1)/2
n = (k-1)/2 + 1
if k % 2 == 0:
  print(int((k/2)**2))
else :
  print(int(m*n))
n = input()
lst = sorted([int(x) for x in input().split()], reverse=True)
alice = 0
bob = 0
while len(lst)>0:
    alice += lst.pop(0)
    bob += lst.pop(0)
print(alice-bob)

### FIXED CODE ###

n = input()
lst = sorted([int(x) for x in input().split()], reverse=True)
alice = 0
bob = 0
for i in range(len(lst)):
    if i%2:
        bob += lst[i]
    else:
        alice += lst[i]
print(alice-bob)
from collections import deque

H, W=map(int, input().split())
ch, cw=map(int, input().split())
dh, dw=map(int, input().split())
ch-=1
cw-=1
dh-=1
dw-=1

grid=["0"]*H
for i in range(H):
    s=input()
    grid[i]=s

Inf=10**12
cost=[[Inf] * W for i in range(H)]

walk=[(0, 1), (0, -1), (-1, 0), (1, 0)]
warp=[]
for i in range(-2, 3):
    for j in range(-2, 3):
        if (i, j) not in walk:
            warp.append((i, j))

q=deque()
cost=[ch][cw]=0
q.append((ch, cw, 0))

while q:
    x, y, c=q.popleft()
    for dx, dy in walk:
        nx = x+dx
        ny = y+dy
        if 0<= nx <= H and 0<= ny <= W and grid[nx][ny]=="." and cost[nx][ny]>c:
            cost[nx][ny]=c
            q.appendleft((nx, ny, c))
    
    for dx, dy in warp:
        nx = x+dx
        ny = y+dy
        if 0<= nx <= H and 0<= ny <= W and grid[nx][ny]=="." and cost[nx][ny]>c+1:
            cost[nx][ny]=c+1
            q.append((nx, ny, c+1))


if cost[dh][dw]==Inf:
    print(-1)
else:
    ans=cost[dh][dw]
    print(ans)

### FIXED CODE ###

from collections import deque


H, W = map(int, input().split())
Ch, Cw = map(lambda x: int(x) - 1, input().split())
Dh, Dw = map(lambda x: int(x) - 1, input().split())
maze = [input() for _ in range(H)]

INF = 10 ** 12
path = [[INF] * W for _ in range(H)]  # path: 各マスへの移動コスト

# walk:移動A, warp:移動B
walk = [(0, 1), (0, -1), (-1, 0), (1, 0)]
warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)] + walk]

q = deque()
path[Ch][Cw] = 0
q.append((Ch, Cw, 0))

while q:
    x, y, s = q.popleft()
    for dx, dy in walk:  # 移動A
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s:
            path[nx][ny] = s
            q.appendleft((nx, ny, s))  # 移動Aの場合はコスト0. キューの先頭に追加する.
    for dx, dy in warp:  # 移動B
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s + 1:
            path[nx][ny] = s + 1
            q.append((nx, ny, s + 1))  # 移動Bの場合はコスト1. キューの最後尾に追加する.
    
ans = path[Dh][Dw] if path[Dh][Dw] < INF else '-1'
print(ans)
import math
n = int(input())
a = list(map(int, input().split()))
a.sort()
max_gcd = 1
if len(a) == 2:
    max_gcd = max(a)
else:
    gcd1 = math.gcd(a[0], a[1])
    gcd2 = math.gcd(a[1], a[2])
    gcd3 = math.gcd(a[2], a[0])
    max_gcd = max(gcd1,gcd2, gcd3)

print(max_gcd)

### FIXED CODE ###

def gcd(a,b):
    l = max(a,b)
    s = min(a,b)
    if s == 0:
        return l
    else:
        return gcd(s, l%s)

n = int(input())
a = [0] + list(map(int, input().split())) + [0]
max_gcd = 1
L = [0] * (n+2)
R = [0] * (n+2)

for i in range(1,n+2):
    L[i] = gcd(a[i],L[i-1])
    R[n+1-i] = gcd(a[n+1-i], R[n+2-i])
for i in range(1,n+1):
    max_gcd = max(max_gcd,gcd(L[i-1], R[i+1]))

print(max_gcd)
N,M = map(int,input().split())
ab = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append((a,b))
cd = []
for i in range(N):
    a,b = map(int,input().split())
    cd.append((a,b))
ans = []
for i in range(len(ab)):
    aaa = 1000000000
    for j in range(len(cd)):
        man = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
        if(man < aaa):
            aaa = man
            cnt = j + 1
    ans.append(cnt)
for i in ans:
    print(i)

### FIXED CODE ###

N,M = map(int,input().split())
ab = []
for i in range(N):
    a,b = map(int,input().split())
    ab.append((a,b))
cd = []
for i in range(M):
    c,d = map(int,input().split())
    cd.append((c,d))
ans = []
for i in range(len(ab)):
    aaa = 1000000000
    for j in range(len(cd)):
        man = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
        if(man < aaa):
            aaa = man
            cnt = j + 1
    ans.append(cnt)
for i in ans:
    print(i)
A, B, C, X  = map(int, input().split())
tmp = 0
for a in range(0,(A+1)):
    for b in range(0,(B+1)):
        for c in range(0,(C+1)):
            total = 500*a + 100*b + 50*c
            if total == X:
                tmp += 1    
print(tmp)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
tmp = 0
for a in range(0,(A+1)):
    for b in range(0,(B+1)):
        for c in range(0,(C+1)):
            total = 500*a + 100*b + 50*c
            if total == X:
                tmp += 1    
print(tmp)
import sys
a=[0,0]+[1]*10**6
for i in range(999):
 if a[i]:a[i*2::i]=[0 for j in a[i*2::i]]
for e in sys.stdin:print(len([i for i in li[:int(e)+1]if i]))


### FIXED CODE ###

import sys
m=500000;a=[1]*m
for i in range(3,999,2):
 if a[i//2]:a[i*i//2::i]=[0]*len(a[i*i//2::i])
p=[]
for i in range(m*2):p+=[i-1 if i<4 else p[i-1]+[0,a[i//2]][i%2]]
for e in sys.stdin:print(p[int(e)])
from collections import deque
H, W = map(int, input().split())
 
route = []
for _ in range(H):
  route.append(input())
  
wall = set()
start = []
for y, r in enumerate(route):
  for x, w in enumerate(r):
    if w == '#':
      wall.add((x, H-y-1))
    else:
      if y > 0 and y < H and x > 0 and x < W:
        a = route[H-y-1+1][x] == '#'
        b = route[H-y-1][x+1] == '#'
        c = route[H-y-1-1][x] == '#'
        d = route[H-y-1][x-1] == '#'
        if (a and c) or (b and d):
          continue
      start.append((x, H-y-1))

score = -1
for xy in start:
  d = deque()
  d.append((xy[0],xy[1],0))
  step = 0
  already = set() | wall
  while len(d) > 0:
    now = d.popleft()
    already.add(now[:-1])
    step = now[2]+1
    x,y = now[0]-1, now[1]
    if (x, y) not in already and x >= 0:
      d.append((x, y, step))
    x, y = x+1, y-1
    if (x, y) not in already and y >= 0:
      d.append((x, y, step))
    x, y = x+1, y+1
    if (x, y) not in already and x < W:
      d.append((x, y, step))
    x, y = x-1, y+1
    if (x, y) not in already and y < H:
      d.append((x, y, step))
  score = max(step-1, score)
  
print(score)

### FIXED CODE ###

from collections import deque
import copy
H, W = map(int, input().split())
 
route = []
for _ in range(H):
  route.append(input())
  
wall = set()
start = set()
for y, r in enumerate(route):
  for x, w in enumerate(r):
    if w == '.':
      start.add((x, y))

score = -1
ssize = [(-1,0),(0,-1),(1,0),(0,1)]
for xy in start:
  d = deque()
  d.append((xy+(0,)))
  step = 0
  can = copy.deepcopy(start)
  can.remove(xy)
  while len(d) > 0:
    now = d.popleft()
    step = now[2]
    for xs, ys in ssize:
      nxt = (now[0]+xs, now[1]+ys)
      if nxt in can:
        d.append(nxt+(step+1,))
        can.remove(nxt)
  score = max(step, score)
  
print(score)
import math

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

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


for i in range(1,k+1):
    a = comb(k-1, i-1)
    b = comb(n-k+1, i)
    print((a*b)%(10**9+7))

    
    


for i in range(1,k+1):
    a = comb(k-1, i-1)
    b = comb(n-k+1, i)
    print((a*b)%(10**9+7))





### FIXED CODE ###

import math

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

def comb(n, r):
    if n-r>=0:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else: 
        return 0

for i in range(1,k+1):
    a = comb(k-1, i-1)
    b = comb(n-k+1, i)
    print((a*b)%(10**9+7))
n, m = map(int, input().split())
a = [0] * m
dp = [1, 1]

for i in range(m):
    a[i] = int(input())

for i in range(len(a)-1):
    if a[i+1] - a[i] == 1:
        print(0)
        exit()

x = 0
for i in range(1, n+1):
    if i != a[x]:
        dp.append((dp[-1] + dp[-2]) % 1000000007)
    else:
        dp.append(0)
        if x < len(a)-1:
            x += 1
# print(dp)
print(dp[-1])


### FIXED CODE ###

n, m = map(int, input().split())
a = [0] * 100100
dp = [1, 1]
x = 0
for i in range(m):
    a[i] = int(input())
if a[0] == 1:
    dp[1] = 0
    x = 1

for i in range(len(a)-1):
    if a[i+1] - a[i] == 1:
        print(0)
        exit(0)


for i in range(2, n+1):
    if i != a[x]:
        dp.append((dp[-1] + dp[-2]) % 1000000007)
    else:
        dp.append(0)
        if x < len(a)-1:
            x += 1
# print(dp)
print(dp[-1])
# -*- coding: utf-8 -*-

a, b, x = map(int,raw_input().split())
cnt = 0

for i in range(a,b):
    if i % x == 0:
        cnt = cnt + 1

print int(cnt)

### FIXED CODE ###

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

x = raw_input()
a = x.split()[0]
s = x.split()[1]
b = x.split()[2]

print a[0]+s[0]+b[0]
S[3]
S[1]=input()
S[2]=input()
S[3]=input()
if not S[1]==S[2]and S[2]==S[3]:
	print('No')
else:
	print('Yes')

### FIXED CODE ###

S=input()
if S[0]==S[1]and S[1]==S[2]:
	print('No')
else:
	print('Yes')
n=int(input())
b=list(map(int,input().split()))
s_b=sorted(list(set(b)),reverse=True)
ans=[]
for itr in range(n):
  for j in s_b:
    if len(b)>=j:
      if b[j-1]==j:
        b=b[:j-1]+b[j:]
        ans.append(j)
        break
    if j==1:
      print(-1)
      exit()
ans.reverse()
for i in range(n):
  print(ans[i])


### FIXED CODE ###

n=int(input())
b=list(map(int,input().split()))
s_b=sorted(list(set(b)),reverse=True)
if 1 not in s_b:
  print(-1)
  exit()
ans=[]
for itr in range(n):
  for j in s_b:
    if len(b)>=j:
      if b[j-1]==j:
        b.pop(j-1)
        ans.append(j)
        break
    if j==1:
      print(-1)
      exit()
ans.reverse()
for i in range(n):
  print(ans[i])
A,B = input().split()
A,B = int(A),int(B)
ans = [A+B,A-B,A*B]
sort(ans)
print(ans.pop())


### FIXED CODE ###

A,B = input().split()
A,B = int(A),int(B)
ans = [A+B,A-B,A*B]
ans.sort()
print(ans.pop())
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[1]=1
b[2]=2

for i in range(0,m):
  a.append(int(input()))
  
if 1 in a:
  b[1]=0
  if 2 in a:
    b[2]=0
  else:
    b[2]=1
  
for j in range(3,n+1):
  if j in a:
    continue
  else:
    b[j]=b[j-1]+b[j-2]
    
print(b[n]%(10**9+7))    
    
  
  
  



### FIXED CODE ###

n,m=map(int,input().split())
mod=10**9+7
a=[0]*(n+1)
dp=[0]*(n+1)
dp[0]=1
for i in range(m):
    a[int(input())]=1
    
if a[1]==1:
    dp[1]=0
else:
    dp[1]=1
    
for j in range(2,n+1):
    if a[j]==0:
        dp[j]=dp[j-1]+dp[j-2] 
                  
print(dp[n]%mod)
s = input()
for i in range(len(s)):
  s.pop(-1)
  if len(s) % 2 == 0:
    if s[:len(s)//2] == s[len(s)//2:]:
      print(len(s))
      break


### FIXED CODE ###

s = input()
for i in range(len(s)):
  s = s[:-1]
  if len(s) % 2 == 0:
    if s[:len(s)//2] == s[len(s)//2:]:
      print(len(s))
      break
a= str(input())
kaibun = list(a)
n = int(len(kaibun))
answer = "No"
strongn1 = int((n-1)/2)
strongn2 = int((n+3)/2)
for i in reversed(range((int((n+1)/2)),n)):
    if kaibun[i] == kaibun[n-i-1]:
        answer = "Yes"
    else:
        answer = "No"
        break;
if answer == "Yes":
    for i in range(int(strongn1/2)):
        if kaibun[i] == kaibun[strongn1-i-1]:
            answer = "Yes"
        else:
            answer="No"
            break;
if answer =="Yes":
    for i in reversed(range(strongn2,n,int(strongn1/2))):
        if kaibun[i] == kaibun[strongn2-2-i+n]:
            answer = "Yes"
        else:
            answer = "No"

print(answer)


### FIXED CODE ###

a= str(input())
kaibun = list(a)
n = int(len(kaibun))
answer = "No"
strongn1 = int((n-1)/2)
strongn2 = int((n+3)/2)
for i in reversed(range((int((n+1)/2)),n)):
    if kaibun[i] == kaibun[n-i-1]:
        answer = "Yes"
    else:
        answer = "No"
        break

if answer == "Yes":
    for i in range(int(strongn1/2)):

        if kaibun[i] == kaibun[strongn1-i-1]:
            answer = "Yes"
        else:
            answer="No"
            break
if answer == "Yes":
    for i in reversed(range(strongn2+int(strongn1/2)-1,n)):
        if kaibun[i] == kaibun[strongn2-2-i+n]:
            answer = "Yes"
        else:
            answer = "No"
            break
print(answer)
def count(list):
    a,b=0,0
    for i in range(len(list)):
        if list[i][0]=='B':
            b+=1
        if list[i][-1]=='A':
            a+=1
    if a==b:
        return a-1
    else:
        return min(a,b)
def check(string):
    c=0
    for i in range(len(string)-1):
        if string[i]=='A' and string[i+1]=='B':
            c+=1
    return c
n=int(input())
m,l=0,[]
for i in range(n):
    s=input()
    m+=check(s)
    
    l.append(s)
m+=count(l)

print(m)
    


### FIXED CODE ###

m=list(map(int, input().strip().split()))
print(m[0]-m[1]+1)
def check(N, K):
    if K < N - 2:
        print(-1)
        return
    if K == N - 2:
        print(N-1)
        for i in range(1, N):
            print(i, i+1)
        return
    if N-1 <= K and K < (N - 1)*(N-2) /2:
        k = (N - 1)*(N-2) /2 - K
        print(N-1 + k)
        for i in range(2, N+1):
            print(1, i)
        l = 2
        r = 3
        for i in range(k):
            print(l, r)
            r+=1
            if r == N+2:
                l+=1
                r=l+1
        return
    if (N - 1)*(N-2) /2 == K:
        print(-1)
        for i in range(2, N+1):
            print(1, i)
        return
    if (N - 1)*(N - 2) /2 < K:
        print(-1)
        return


if __name__ == "__main__":
    N, K = map(int, input().split())
    check(N, K)


### FIXED CODE ###

def check(N, K):
    if K <= (N - 1)*(N-2) /2:
        k = int((N - 1)*(N-2)/2 - K)
        print(N-1 + k)
        for i in range(2, N+1):
            print(1, i)
        l = 2
        r = 3
        if k != 0:
            for i in range(k):
                if l > N or r > N:
                    break
                print(l, r)
                r+=1
                if r == N+1:
                    l+=1
                    r=l+1
        return
    else:
        print(-1)
        return


if __name__ == "__main__":
    N, K = map(int, input().split())
    check(N, K)
O = input()
E = input()

for i in range(len(a)):
    print(O[i] + E[i], end="")

### FIXED CODE ###

o = list(input())
e = list(input()) + [""]

for x,y in zip(o,e):print(x + y, end = "")
n = int(input())
d,x = list(map(int,input().split()))
res = 0
for i in range(n):
  res = res + int((d+i-1)/i)  

print(res+x)



### FIXED CODE ###

n = int(input())
d,x = list(map(int,input().split()))
res = 0
for i in range(n):
  a = int(input())
  res = res + int((d+a-1)/a)  

print(res+x)
n = int(input())
s = set()

for i in range(1,int(n**0.5)+2):
    if n//i == n%i:
        s.add(i)
    x = (n-i)//i
    if n//x== n%x:
        s.add(x)
print(sum(list(s)))


### FIXED CODE ###

n = int(input())
s = set()

for i in range(1,int(n**0.5)+1):
    if n//i == n%i:
        s.add(i)
    x = (n-i)//i
    if x and n//x == n%x:
        s.add(x)
print(sum(list(s)))
n = int(input())
a = map(int, input.split())
b = map(int, input.split())
c = map(int, input.split())  

former = -10
satisfy = 0
for i in a:
    satisfy += b[i-1]
    if i == former + 1:
        satisfy += c[i-2]
    former = i
print(satisfy)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

former = -10
satisfy = 0
for i in a:
    satisfy += b[i-1]
    if i == former + 1:
        satisfy += c[i-2]
    former = i
print(satisfy)
a = int(input())
if 7 in a:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = [x for x in input()]
for i in range(len(a)):
    if a[i] == '7':
        a[i] = True
    else:
        a[i] = False
if any(a):
    print("Yes")
else:
    print("No")
a = int(input())
b = int(input())
soma, mult, minus = a+b, a*b, a-b 
if(soma > mult and soma > minus):
    print(soma)
elif(mult > minus):
    print(mult)
else:
    print(minus)

### FIXED CODE ###

A,B = map(int,input().split())
ans = max(A+B, A-B, A*B)
print(ans)
ans = [0 for i in range(23)]
S = list(map(ord,input().upper()))
S = [e for e in S if 64<e<91]
print(S)
for i in S:
    ans[i-65]+=1
for i in range(26):
    print("{} : {}".format(chr(97+i),ans[i]))


### FIXED CODE ###

import sys
input_str = sys.stdin.read()
table = [0]*26
letters = "abcdefghijklmnopqrstuvwxyz"
for A in input_str:
    index = 0
    for B in letters:
        if A == B or A == B.upper():
            table[index] += 1
            break
        index += 1
for i in range(len(letters)):
    print("{} : {}".format(letters[i],table[i]))
a = int(input())
sam = 0
b = 0
for i in range(5):
  b = int(input())
  sam += b**-2
print(sam**-2)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
sam = 0
for i in range(N):
  sam += A[i]**-1
print(sam**-1)
while True:
 h, w = map(int, raw_input().split())
 if (h == 0 and w == 0):
   break
 for i in range(0,h):
   for j in range(0,w):
     if i==0 or j==0 or i==h-1 or j==w-1:
??????   print ("#")
     else: 
       print (".")
   print
 print

### FIXED CODE ###

while True:
  h, w = map(int, raw_input().split())
  if (h == 0 and w == 0):
    break
  for i in range(0,h):
    if i == 0 or i == h-1:
      print ('#' * w)
    else: 
      print ('#' + '.' * (w - 2) + '#' )
  print
def sum(x):
  y = x;
  sum = 0
  while y > 0:
    sum = sum + (y % 10)
    y = y // 10

  return sum

i = int ( input () )
print( "Yes" if (x % sum(x) == 0) else "No")


### FIXED CODE ###

n = input()
len_n = len(n)
sum_n = 0;
for i in range (len_n):
    sum_n += int(n[i])
if(int(n) % sum_n == 0):
    print("Yes")
else:
    print("No")
dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre) ):
        a = a[:len(a)-7]
	elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)


### FIXED CODE ###

dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre)):
        a = a[:len(a)-7]
    elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)
for i in range(N):
    print(i)

### FIXED CODE ###

N=int(input())
result = 0;
for i in range(1,N+1):
    result += i
        
print(result)
while True:
  H,W=map(int,input().split())
  for i in range(H):
      if a==b==0:
        break
      print("#"*W)
  print("\n")


### FIXED CODE ###

while True:
  H,W=map(int,input().split())
  if H==0 and W==0:
      break
  for i in range(H):
      print("#"*W)
  print()
#!/usr/bin/env python3
import sys
from itertools import accumulate
INF = float("inf")


def solve(N: int, C: int, s: "List[int]", t: "List[int]", c: "List[int]"):
    # いもす法
    seq = [0]*(10**5)
    for sv, tv, cv in zip(s, t, c):
        seq[sv] += 1
        seq[tv+1] -= 1
    acc = list(accumulate(seq))
    # print(seq)
    # print(acc)
    print(max(acc))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    s = [int()] * (N)  # type: "List[int]"
    t = [int()] * (N)  # type: "List[int]"
    c = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        s[i] = int(next(tokens))
        t[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, C, s, t, c)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from itertools import accumulate
INF = float("inf")


def solve(N: int, C: int, s: "List[int]", t: "List[int]", c: "List[int]"):
    seq = [0]*(3*10**5)
    # チャンネルを切り替えない場合、0.5秒のラグが発生しない。
    # 同じチャンネルでしりとあたまがいっしょなら、ひとつの番組にしておく
    c, s, t = zip(*sorted(sorted(zip(c, s, t), key=lambda x: x[1])))
    # いもす法
    # seq = [0]*(40)
    pre_s, pre_t, pre_c = -1, -1, -1
    for sv, tv, cv in zip(s, t, c):
        if pre_c == cv and pre_t == sv:
            seq[2*pre_t] += 1
            seq[2*tv] -= 1
        else:
            seq[2*sv-1] += 1
            seq[2*tv] -= 1
        pre_s, pre_t, pre_c = sv, tv, cv
    acc = list(accumulate(seq))
    # print(seq)
    # print(acc)
    print(max(acc))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    s = [int()] * (N)  # type: "List[int]"
    t = [int()] * (N)  # type: "List[int]"
    c = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        s[i] = int(next(tokens))
        t[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, C, s, t, c)


if __name__ == '__main__':
    main()
import math

inf = 10**9+7

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

red = n - blue
for i in range(1,blue+1):
    print(combinations_count(red+1, i)*combinations_count(blue-1, i-1)%inf)

### FIXED CODE ###

import math

inf = 10**9+7

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

red = n - k
for i in range(1,k+1):
    if red+1 >= i:
        print(combinations_count(red+1, i)*combinations_count(k-1, i-1)%inf)
    else:
        print(0)
all_failure = 0
all_AC = 0
scan = 0
for j in range(N):
    while M < scan:
        #print(j,i,int(A[scan][0]), A[scan][1])
        if int(A[scan][0]) == j+1 and A[scan][1] == "WA":
            all_failure += 1
            scan+=1
        elif int(A[scan][0]) == j+1 and A[scan][1] ==  "AC":
            all_AC+=1
            scan+=1
            break
        elif int(A[scan][0]) < j:
            scan += 1
        else:
            break
        
print(all_AC, all_failure)

### FIXED CODE ###

N, M = map(int, input().split())
pSs = [list(map(str, input().split())) for _ in range(M)]

#%%

ACs = [False for _ in range(N)]
WAs = [0 for _ in range(N)]

for pS in pSs:
    problem = int(pS[0]) -1
    answer = pS[1]
    if ACs[problem] == True:
        continue
    else:
        if answer == "WA":
            WAs[problem] += 1
        else:
            ACs[problem] = True

num_WA = 0
for i, WA in enumerate(WAs):
    if ACs[i] == True:
        num_WA += WA

print(sum(ACs), num_WA)
import numpy as np
input()
x=np.array(input().split(),dttype=np.int32)
ans=0
while (x%2==0).all():
    x//2
    ans +=1
print(answer)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
result = float('inf') 
for i in a:
    result = min(result,len(bin(i))-bin(i).rfind('1')-1)
print(result)
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
a=abs(x[0]-X)
for i in range(1,n):
    b=abs(x[i]-X)
    ans=fractions.gcd(a,b)
    a=ans
print(ans)

### FIXED CODE ###

import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
ans=abs(x[0]-X)
for i in range(1,n):
    b=abs(x[i]-X)
    ans=fractions.gcd(ans,b)
print(ans)