Harryxun/stf_run huggingface dataset:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
ans = 0
if b == 1:
    print(ans)
    exit()

while(1):

    if ans == 0:
        b -= a
        ans += 1
    else:
        if b <= 0:
            print(ans)
            exit()
        else:
            b -= (a-1)
            ans += 1

    

# n = INT()
# a, b, c = MAP()
# ans = 1
# # count = 0
# count = a
# flag = False
# # for i in range(30):
# while flag == False:
#     if count >= b:
#         flag = True    
#     else:
#         count += a-1
#         ans += 1
# print(ans)





# k = 1
# count = 0
# ans = 0
# A = []


# count += a
# ans += 1


# while(1):
#     if count >= b:
#         print(ans)
#         exit()
#     else:
#         count += a-1
#         ans += 1
#         # print()




# count += a
# ans += 1

# for i in range(100):
#     if b <= count:
#         print(ans)
#         exit()

#     else:
#         count += a-1
#         ans += 1 
#         # print(ans)

# for i in range(30):
# while(1):
#     count += a
#     ans += 1
#     print(count)

#     if b <= count:
#         print(ans)
#         exit()
#     else:   
#         count = count-1
#     # print(ans)
    
    # # A.append(a)
    # # if sum(A)
    # if count == 0:
    #     count += a
    #     ans += 1
    # else:
    #     count += a-1
    #     ans += 1
    # print(count)
    # print(ans)
    # if b<=count:
    #     # print(count)
    #     print(ans)
    #     exit()



### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = list(input())
T = list(input())

count = 0
for i in range(len(S)):
    if S[i] == T[i]:
        count += 1
# a, b = MAP()
# n = INT()
# a, b, c = MAP()

print(count)
N,P =map(int,input().split(' '))
if N==1:
    print(P)
    raise ValueError
    exit()

for i in range(int(pow(P,1/N)//1),0,-1):
    if P%pow(i,N)==0:
        print(i)
        break

### FIXED CODE ###

from collections import Counter
N,P =map(int,input().split(' '))
if N==1:
    print(P)
    exit()
prime = []
f = 2
while f**2 <=P:
    if P%f==0:
        prime.append(f)
        P//=f
    else:
        f += 1
if P != 1:
    prime.append(f)

ans = 1
for k,v in Counter(prime).items():
    if v//N:
        ans *= k**(v//N)
print(ans)
N=input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)<sum(b):
    print(-1)
    exit()

count=0

d=[]
for i in range (N):
    _d=a[i]-b[i]
    d.append(_d,i)
print(d)


### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)<sum(b):
    print(-1)
    exit()

p=0

ori_d=[]
for i in range (N):
    _d=a[i]-b[i]
    ori_d.append([i,_d])

d=sorted(ori_d,key=lambda x: x[1])
d2=[0]*N
for j in range (N):
    if d[j][1]>=0:
        break
    else:
        p+=abs(d[j][1])
        d2[j]+=1

for k in range (N-1,0,-1):
    if p==0:
        break
    elif d[k][1]<p:
        p-=d[k][1]
        d[k][1]=0
        d2[k]+=1
    else:
        d[k][1]-=p
        p=0
        d2[k]+=1

print(sum(d2))
import time


def main():

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

    sum = [0]

    for i in range(0, N):
        if S[i] == 'A' and S[i+1] == 'C': sum[i+1] = sum[i] + 1
        else: sum[i+1] = sum[i]

    for i in range(0, Q):
        l, r = map(int, input().split())
        print(sum[r] - sum[l])


if __name__ == '__main__':
    start = time.perf_counter()

    main()

    end = time.perf_counter()
    print(end - start)


### FIXED CODE ###

import time


def main():

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

    sum = [0] * (N + 1)

    for i in range(1, N):
        if S[i-1] == 'A' and S[i] == 'C': sum[i] = sum[i-1] + 1
        else: sum[i] = sum[i-1]

    for i in range(Q):
        l, r = map(int, input().split())
        print(sum[r-1] - sum[l-1])


if __name__ == '__main__':
    start = time.perf_counter()

    main()

    end = time.perf_counter()
    # print(end - start)
import math

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


x, y = map(int, input().split())
if ((x + y) % 3 != 0):
	print("0")
elif (x > 2*y or y > 2_x):
	print("0")
else:
	n_x = (2 * x - y) // 3
	n_y = (2 * y - x) // 3
	n_xy = (x + y) // 3
	print(cmb(n_xy,n_x)%1000000007)


### FIXED CODE ###

import math

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


x, y = map(int, input().split())
if ((x + y) % 3 != 0):
	print("0")
elif (x > 2*y or y > 2*x):
	print("0")
else:
	n_x = (2 * x - y) // 3
	n_y = (2 * y - x) // 3
	n_xy = (x + y) // 3
	print(cmb(n_xy,n_x)%1000000007)
X,Y,A,B,C= map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
N = list(map(int, input().split()))

R.sort()
G.sort()
N.sort(reverse=True)
R2 = R[-X:]
G2 = G[-Y:]

W = sorted(R2 + G2)

for i in range(C):
	if W[i] < N[i]:
		W[i] = N[i]

print(sum(W))

### FIXED CODE ###

X,Y,A,B,C= map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
N = list(map(int, input().split()))

R.sort(reverse=True)
G.sort(reverse=True)
N.sort(reverse=True)

R2 = R[:X]
G2 = G[:Y]

W = sorted(R2 + G2 + N, reverse=True)

print(sum(W[0:X+Y]))
dish = [int(input()) for d in range(5)]
diff = 0
ans = []
for index,d in enumerate(dish):
  if d % 10 != 0:
    tmp = (d //10) +1
    d10 = tmp * 10
    ans.append(d10)
  else:
    ans.append(d)
  if d % 10 != 0 and diff < d10-d:
    diff = d10-d
    last= index

ans.remove(ans[last])

print(sum(ans)+dish[last])



### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
dish = [a,b,c,d,e]
last = 0
for index,d in enumerate(dish):
  if d % 10 != 0:
    d10 = ((d // 10)+1) *10
    if last <= d10 - d:
      last = d10 - d
    dish[index] = d10
print(sum(dish)-last)
import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
mod = 10 ** 9 + 7

ans = 0
for i in range(64):
    tmp = (A >> i) & 1
    #print(tmp)
    x = np.count_nonzero(tmp)
    x *= n - x
    ans += pow(2, i, mod) * x % mod

print(ans % mod)


### FIXED CODE ###

import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
mod = 10 ** 9 + 7

ans = 0
for i in range(64):
    tmp = (A >> i) & 1
    #print(tmp)
    x = np.count_nonzero(tmp)
    x *= n - x
    ans += pow(2, i, mod) * x % mod

print(ans % mod)
k, n = map(int, input().split())
if n == 0:
    print(0)
else:
    l = list(map(int, input().split()))
    l.sort()
    k1 = [i for i in range(min(l), max(l) + 1) if i not in l]
    d = {}
    for i in range(len(k1)):
        d[k1[i]] =max(k1[i],k)-min(k1[i],k)
    k2 = min(d, key=d.get)
    if len(d)==0 or len(k1)==0:
        print(0)
    else:
        print(k2)

### FIXED CODE ###

x,n=map(int,input().split())
l=list(map(int,input().split()))
if x not in l:
    print(x)
elif n==0:
    print(x)
else:
    a=101
    p1=0
    for i in range(102):
        if i not in l:
            if abs(x-i)<a:
                a=abs(x-i)
                p1=i

    print(p1)
a,b = list(map(int,input().split(" "))

print(a*b,a*2+b*2)

### FIXED CODE ###

a,b = list(map(int,input().split(" ")))
 
print(a*b,a*2+b*2)
p=input;a=[i for i in p().split()];print(sum(a)+max(a)*2**int(p()))

### FIXED CODE ###

p=input;a=[int(i)for i in p().split()];m=max(a);print(sum(a)-m+m*2**int(p()))
# A - XOR Circle

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

if a[N-1]==0 and a[N]==a[3*N-1]:
    ans = 'Yes'
elif a[0]==a[N-1] and a[N]==a[2*N-1] and a[2*N]==a[3*N-1] and x^y^z==0:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

### FIXED CODE ###

# A - XOR Circle

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

if a[N-1]==0:
    ans = 'Yes'
elif N%3!=0:
    ans = 'No'
elif a[0]==a[N//3-1] and a[N//3]==a[2*N//3-1] and a[2*N//3]==a[N-1] and a[0]^a[N//3]^a[2*N//3]==0:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)
import math
from decimal import *
a,b,c = map(int,input().split())
if decimal(math.sqrt(a)) + decimal(math.sqrt(b)) < decimal(math.sqrt(c)): print("Yes")
else: print("No")

### FIXED CODE ###

from decimal import *
a,b,c = map(int,input().split())
print("Yes" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else "No")
n=int(input())
a=list(map(int,input().split()))
b=set(a)
if len(b)==3:
  print('Three')
if len(b)==4:
  print('Four')


### FIXED CODE ###

n=int(input())
a=list(input().split())
b=set(a)
if len(b)==3:
  print('Three')
if len(b)==4:
  print('Four')
N = int(input())
x = [0]*N
y = [0]*N
h = [0]*N

for i in range(N):
	x[i], y[i], h[i] = map(int, input().split())
for cx in range(101):
	for cy in range(101):
		H = abs(x[0]-cx)+abs(y[0]-cy)+h[0]
		for i in range(N):
			# if H != abs(x[i]-cx)+abs(y[i]-cy)+h[i]:
			if h[i] != max(H-abs(x[i]-cx)-abs(y[i]-cy), 0):
				break
			if i == N-1:
				ans = [cx, cy, H]
				break
print(ans[0],ans[1],ans[2])


### FIXED CODE ###

N = int(input())
p = [0, 0, 0]*N

p = [list(map(int, input().split())) for _ in range(N)]
p = sorted(p, key=lambda x:-x[2])
for cx in range(101):
	for cy in range(101):
		H = abs(p[0][0]-cx)+abs(p[0][1]-cy)+p[0][2]
		for i in range(N):
			# if H != abs(x[i]-cx)+abs(y[i]-cy)+h[i]:
			if p[i][2] != max(H-abs(p[i][0]-cx)-abs(p[i][1]-cy), 0):
				break
			if i == N-1:
				ans = [cx, cy, H]
				break
print(ans[0],ans[1],ans[2])
nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
    try:
        s=input()
    except:
        break
    ans=nums[s[0]]
    for i in range(len(s)):
        if num[s[i-1]]<num[s[i]]:
            ans+=num[s[i]]-2*num[s[i-1]]
        else:
            ans+=num[s[i]]
    print(ans)
        

### FIXED CODE ###

nums={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
while True:
    try:
        s=input()
    except:
        break
    ans=nums[s[0]]
    for i in range(1,len(s)):
        if nums[s[i-1]]<nums[s[i]]:
            ans-=2*nums[s[i-1]]
        ans+=nums[s[i]]
    print(ans)
n,k=map(int,input().split())
a=list(map(int,input().split()))
mod=10**9+7
a.sort()
def fact(n):
  if n==0:
    return 1
  else:
    s=1
    for i in range(1,n+1):
      s=s*i
    return s
def comb(n,k,mod):
  return (fact(n)//fact(k)//fact(n-k))%mod

if k>1:
  s=0
  for i in range(0,n-k):
    for j in range(i+k-1,n-1):
      s+=((a[j]-a[i])*comb(j-i-1,k-2,mod))%mod
  print(s%mod)
else:
  print(0)


### FIXED CODE ###

C=str(input())
a=ord(C)
print(chr(a+1))
n=input()
satis=[]

for i in range(n):
	satis.append(map(int,input().split()))

#n=3
#satis=[10, 40, 70, 20, 50, 80, 30, 60, 90]

tempA=satis[0]
tempB=satis[1]
tempC=satis[2]
if n > 1:
  for i in range(n-1):
    print([satis[3*i+3],satis[3*i+4],satis[3*i+5]])
    tempA2=satis[3*i+3]+max([tempB,tempC])
    tempB2=satis[3*i+4]+max([tempA,tempC])
    tempC2=satis[3*i+5]+max([tempA,tempB])
    tempA=tempA2
    tempB=tempB2
    tempC=tempC2
else:
  print(max([tempA,tempB,tempC]))

### FIXED CODE ###

n=int(input())
satis=[]

for i in range(n):
  A=list(map(int,input().split()))
  satis.extend(A)

tempA=satis[0]
tempB=satis[1]
tempC=satis[2]
if n > 1:
  for i in range(n-1):
    tempA2=satis[3*i+3]+max([tempB,tempC])
    tempB2=satis[3*i+4]+max([tempA,tempC])
    tempC2=satis[3*i+5]+max([tempA,tempB])
    tempA=tempA2
    tempB=tempB2
    tempC=tempC2
  print(max([tempA,tempB,tempC]))
else:
  print(max([tempA,tempB,tempC]))
N = int(intpu())
if N % 2 == 0:
  print(N)
else:
  print(N*2)

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
  print(N)
else:
  print(N*2)
import fractions
l = map(int, raw_input().split())
toshisuu= l[0]
starttoshi= l[1]
mathlist=[0]
toshilist = map(int, raw_input().split())
ans=100000000000000000000
das=0
for i in toshilist:
    counts=abs(i-starttoshi)
    if das==0:
        mathlist[0]=counts
        das=1
    else:
        mathlist.append(counts)
mathlist.sort(reverse = True)
# print mathlist
print fractions.gcd(mathlist[0], mathlist[1])


### FIXED CODE ###

ls = raw_input().split()
l=[0,0]
l[0]=int(ls[0])
l[1]=int(ls[1])

if (l[0]%2==0)or(l[1]%2==0):
    print "No"
else:
    print "Yes"
#E
from collections import deque
n = int(input())
matches = [list(a -1 for a in map(int,input().split()))
     for _ in range(N)]
q = deque(range(n))
depth = [0] * n
waiting = [-1] * n

while q:
    a = q.popleft()
    ma = matches[a]
    if not ma:
        continue
    # gyaku kara kanngaeteru
    b = ma.pop()
    if waiting[b] == a:
        depth[a] = depth[b] = max(depth[a],depth[b]) +1
        q.append(a)
        q.append(b)
    else:
        waiting[a] = b
if any(matches):
    print(-1)
else:
    print(max(depth))

### FIXED CODE ###

#E
from collections import deque
n = int(input())
matches = [list(a -1 for a in map(int,input().split()))
     for _ in range(n)]
q = deque(range(n))
depth = [0] * n
waiting = [-1] * n

while q:
    a = q.popleft()
    ma = matches[a]
    if not ma:
        continue
    # gyaku kara kanngaeteru
    b = ma.pop()
    if waiting[b] == a:
        depth[a] = depth[b] = max(depth[a],depth[b]) +1
        q.append(a)
        q.append(b)
    else:
        waiting[a] = b
if any(matches):
    print(-1)
else:
    print(max(depth))
X=int(input())
print(print('{:.0f}'.format(round(X/500)*1000+round(rem(X/500)/5)*5)))

### FIXED CODE ###

import math
X=int(input())
A=math.floor(X/500)*1000+math.floor(X%500/5)*5
print('{:.0f}'.format(A))
aa = list(map(int,input().split()))
bb = ["Left","Right","Balanced"]
a,b,c,d = [i for i in aa]

print(bb[0] if a + b > c +d)
print(bb[1] if a + b < c +d)
print(bb[2] if a + b == c +d)

### FIXED CODE ###

aa = list(map(int,input().split()))
bb = ["Left","Right","Balanced"]
a,b,c,d = [i for i in aa]

if a + b > c +d:
    print(bb[0] )
if a + b < c +d:
    print(bb[1] )
if a + b == c +d:
    print(bb[2] )
# 1-index
from sys import stdin
import numpy as np
N,C = [int(x) for x in stdin.readline().rstrip().split()]
imos = [[0]*(10**5+2) for i in range(C+1)]
 
for i in range(N):
    s,t,c = [int(x) for x in stdin.readline().rstrip().split()]
    imos[c][s] += 1
    imos[c][t+1] -= 1
 
imos = np.array(imos)[:,:-1]
#print(np.cumsum(imos,axis=1))
ans = max(np.cumsum(imos,axis=1).sum(axis=0))
print(ans)

### FIXED CODE ###

from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
print(min(A*N,B))
gomi=input()
tako=[int(i) for i in input().split()]
print(int((sum(tako)**2-sum([i**2 for i in tako]))/2))  

### FIXED CODE ###

a,b = map(int,input().split())
print(max(0,a-2*b))
n=int(input())
l=list(map(int,input().split()))
for i in range(n):
  l[i]=l[i]-i-1
l=sorted(l)
if n%2==0:
  mid=(l[n/2-1]+l[n/2])
else:
  mid=l[n/2]
sum=0
for i in range(n):
  sum+=abs(l[i]-mid)
print(sum)


### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
for i in range(n):
  l[i]=l[i]-i-1
l=sorted(l)
if n%2==0:
  mid=(l[n//2-1]+l[n//2])//2
else:
  mid=l[(n-1)//2]
sum=0
for i in range(n):
  sum+=abs(l[i]-mid)
print(sum)
def B_Addition_and_Multiplication(N, K):
  	if N==1:
      return 2
    multiply = 0  # 掛け算する回数
    add = 0  # 足し算する回数
    tmp = 1
    while tmp < K:
        tmp *= 2
        multiply += 1
    add = N - multiply

    ans = pow(2, multiply) + K * add
    return ans
  
N = int(input())
K = int(input())
print(B_Addition_and_Multiplication(N, K))

### FIXED CODE ###

def B_Addition_and_Multiplication(N, K):
    if N==1:
        return 2
    multiply = 0  # 掛け算する回数
    add = 0  # 足し算する回数
    tmp = 1
    while tmp < K:
        tmp *= 2
        multiply += 1
    add = N - multiply

    ans = pow(2, multiply) + K * add
    return ans
  
N = int(input())
K = int(input())
print(B_Addition_and_Multiplication(N, K))
def popcount(n):
	res=0
	while n > 0:
		res += n % 2;
		n //= 2
	return res
n=0
def init_seg(_n):
	global n
	n = 1
	while n < _n:
		n *= 2
MAX_N=131072
data=[0]*MAX_N
datb=[0]*MAX_N

def add(a, b, x, k, l, r):
	if a <=l and r <= b:
		data[k] += x
	elif l < b and a < r:
		datb[k] += (min(b,r) - max(a,l))*x
		add(a, b, x, 2 * k + 1, l, (l + r) / 2)
		add(a, b, x, 2 * k + 2, (l + r) / 2, r)

def sum(a, b, k, l, r):
	if b <=l or r <= a:
		return 0
	elif a <= l and r <= b:
		return data[k] * (r - l) + datb[k]
	else:
		res = (min(b, r) - max(a, l)) * data[k]
		res += sum(a, b, 2 * k + 1, l, (l + r) / 2)
		res += sum(a, b, 2 * k + 2, (l + r) / 2, r)
		return int(res)

def main():
	N,C=map(int,input().split())
	init_seg(N)
	global n
	for i in range(n):
		add(i, i + 1, 0, 0, 0, n)

	for i in range(N):
		s,t,c=map(int,input().split())
		add(s, t, 2**(c-1), 0, 0, n)

	res=0
	for i in range(1,int(1e5)):
		prev=sum(i - 1, i, 0, 0, n)
		curr=sum(i, i+1, 0, 0, n)
		if prev == curr:
			res = max(res, popcount(curr))
		else:
			res = max(res, popcount(curr | prev))

	print(res)

if __name__ == '__main__':
	main()



### FIXED CODE ###

N,C=map(int,input().split())
f=[[0]*int(1e5) for _ in range(C)]

for i in range(N):
	s,t,c=map(int,input().split())
	f[c-1][s-1:t]=[1]*(t-s+1)

print(max(map(sum,zip(*f))))
# N A B C
# l1
# l2
# ...

(N, A, B, C) = (int(input().split()[i]) for i in range(4))
L = []
for i in range(N):
    l = int(input())
    L.append(l)
# N = 5
# A = 100
# B = 90
# C = 80
# L = [98, 40, 30, 21, 80]

def recur_function(a, b, c, n):
    if n == N:
        return abs(a - A) + abs(b - B) + abs(c - C) if min(a, b, c) > 0 else 10**9
    ret0 = recur_function(a + L[n], b, c, n + 1) + 10 if a > 0 else recur_function(a + L[n], b, c, n + 1)
    ret1 = recur_function(a, b + L[n], c, n + 1) + 10 if b > 0 else recur_function(a, b + L[n], c, n + 1)
    ret2 = recur_function(a, b, c + L[n], n + 1) + 10 if c > 0 else recur_function(a, b, c + L[n], n + 1)
    ret3 = recur_function(a, b, c, n + 1)
    return min(ret0, ret1, ret2, ret3)

print(recur_function(0, 0, 0, 0))

### FIXED CODE ###

S = input()
S_split = S.split("/")
(year, month, day) = (int(S_split[i]) for i in range(3))

if month > 4:
    print("TBD")

else:
    print("Heisei")
S=int(input())
x1,y1=0,0
x2,y2=10**9,1

if S//10**9==0:
  y3=0
  x3=S
else:
  y3=-(-S/10**9//1)
  x3=10**9*x3-S
print(x1,y1,x2,y2,x3,y3)

### FIXED CODE ###

S=int(input())

x1,y1=0,0
x2,y2=10**9,1

y3=-(-S//10**9)
x3=y3*10**9-S

print(x1,y1,x2,y2,x3,y3)
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


class Node(object):
    def __init__(self):
        self.id = None
        self.parent = -1
        self.childs = None


def preorder_walk(data, index, out):
    node = data[index]
    out.append(node.id)
    for cidx in node.childs:
        if cidx >= 0:
            preorder_walk(data, cidx, out)


def inorder_walk(data, index, out):
    node = data[index]
    for cidx in node.childs:
        if cidx >= 0:
            inorder_walk(data, cidx, out)
            if node.id not in out:
                out.append(node.id)
    if node.id not in out:
        out.append(node.id)


def postorder_wark(data, index, out):
    node = data[index]
    for cidx in node.childs:
        if cidx >= 0:
            postorder_wark(data, cidx, out)
    out.append(node.id)


n = int(stdin.readline())
#assert 1 <= n <= 25
data = [Node() for _ in range(n)]
for _ in range(n):
    idx, left, right = (int(s) for s in stdin.readline().split())
    data[idx].id = idx
    data[idx].childs = [left, right]
    for c in data[idx].childs:
        data[c].parent = idx

start = None
for node in data:
    if node.parent == -1:
        start = node.id
        break

for name, func in (('Preorder\n', preorder_walk),
                   ('Inorder\n', inorder_walk),
                   ('Postorder\n', postorder_wark)):
    out = []
    func(data, start, out)
    print(name, *out)

### FIXED CODE ###

#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


class Node(object):
    def __init__(self):
        self.id = None
        self.parent = -1
        self.childs = None


def preorder_walk(data, index, out):
    node = data[index]
    out.append(node.id)
    for cidx in node.childs:
        if cidx >= 0:
            preorder_walk(data, cidx, out)


def inorder_walk(data, index, out):
    cid = data[index].childs[0]
    if cid >= 0:
        inorder_walk(data, cid, out)
    out.append(data[index].id)
    cid = data[index].childs[1]
    if cid >= 0:
        inorder_walk(data, cid, out)


def postorder_wark(data, index, out):
    node = data[index]
    for cidx in node.childs:
        if cidx >= 0:
            postorder_wark(data, cidx, out)
    out.append(node.id)


n = int(stdin.readline())
#assert 1 <= n <= 25
data = [Node() for _ in range(n)]
for _ in range(n):
    idx, left, right = (int(s) for s in stdin.readline().split())
    data[idx].id = idx
    data[idx].childs = [left, right]
    for c in data[idx].childs:
        if c >= 0:
            data[c].parent = idx

start = None
for node in data:
    if node.parent == -1:
        start = node.id
        break

for name, func in (('Preorder\n', preorder_walk),
                   ('Inorder\n', inorder_walk),
                   ('Postorder\n', postorder_wark)):
    out = []
    func(data, start, out)
    print(name, *out)
N = int(input())
print(N*(N-1)//2)

### FIXED CODE ###

N = int(input())
print(N*(N-1)//2)