Harryxun/stf_run huggingface dataset:
A, B, K = map(int, input().split())
if 2 * K > B - A + 1:
	for i in l:
		print(i)
else:
	for i in range(A, A + K):
		print(i)
	for j in range(B - K + 1, B + 1):
		print(j)

### FIXED CODE ###

A, B, K = map(int, input().split())
if 2 * K > B - A + 1:
	for i in range(A, B + 1):
		print(i)
else:
	for i in range(A, A + K):
		print(i)
	for j in range(B - K + 1, B + 1):
		print(j)
# -*- Coding: utf-8 -*-

x = int(input())
min_sosu = x


for i in range(x, 100000):
    for j in range(2, 100000):
        if i%j == 0 and j < x:
            break
        if i%j == 0 and j >= x and i == j:
            min_sosu = i
            print(min_sosu)
            exit(1)

if min_sosu == x:
    print(min_sosu)


### FIXED CODE ###

# -*- Coding: utf-8 -*-

x = int(input())
min_sosu = x
flg_found = False

for i in range(x, 1000000):
    for j in range(2, i*i):
        if i%j == 0 and j < x:
            break
        if i%j == 0 and j >= x and i == j:
            min_sosu = i
            flg_found = True
            print(min_sosu)
            break
    if flg_found:
        break
import sys
input = sys.stdin.readline
N = int(input())
li_L = map(int, input().split())
a = max(li_L)
li_L = li_L.remove(a)
if a < sum(li_L):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
li_L = list(map(int, input().split()))
a = max(li_L)
li_L.remove(a)
if a < sum(li_L):
    print("Yes")
else:
    print("No")
N,X = map(int,input().split())
L = list(map(int,input().split()))

curCoord = 0
n = 1

while (curCoord<=X):
    n=n+1
    curCoord = curCoord+L[n-2]
    
print(n-1)

### FIXED CODE ###

N,X = map(int,input().split())
L = list(map(int,input().split()))

curCoord = 0
n = 1

while (curCoord<=X):
    n = n+1
    
    if (n>N+1):
        break
    else:
        curCoord = curCoord+L[n-2]

print(n-1)
s = input()
if s = "ABC":
    print("ARC")
else:
    print("ABC")

### FIXED CODE ###

s = input()
if s == "ABC":
    print("ARC")
else:
    print("ABC")
h, w, n = map(int, input().split())
ar, ac = map(int, input().split())
s = input()
t = input()
r = ac
l = ac
u = ar
d = ar

for i in range(n):
    if s[i] == "R":
        r += 1
    if s[i] == "L":
        l -= 1
    if s[i] == "U":
        u -= 1
    if s[i] == "D":
        d += 1
    if l==0 or r==w+1 or u==0 or d==h+1:
        print("NO")
        ans = True
        break
        
    if t[i] == "R" and l != w:
        l += 1
    if t[i] == "L" and r != 1:
        r -= 1
    if t[i] == "U" and d != 1:
        d -= 1
    if t[i] == "D" and u != h:
        u += 1
 
if ans != True:
    print("YES")

### FIXED CODE ###

h, w, n = map(int, input().split())
ar, ac = map(int, input().split())
s = input()
t = input()
r = ac
l = ac
u = ar
d = ar
ans = False

for i in range(n):
    if s[i] == "R":
        r += 1
    if s[i] == "L":
        l -= 1
    if s[i] == "U":
        u -= 1
    if s[i] == "D":
        d += 1
    if l==0 or r==w+1 or u==0 or d==h+1:
        print("NO")
        ans = True
        break
        
    if t[i] == "R" and l != w:
        l += 1
    if t[i] == "L" and r != 1:
        r -= 1
    if t[i] == "U" and d != 1:
        d -= 1
    if t[i] == "D" and u != h:
        u += 1
 
if ans != True:
    print("YES")
r1, c1, r2, c2 = map(int, input().split())

MAX = 10 ** 6 + 1
MOD = 10 ** 9 + 7

# Factorial
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1

# Inverse
inv = [0] * (MAX + 1)
inv[1] = 1

# Inverse factorial
finv = [0] * (MAX + 1)
finv[0] = 1
finv[1] = 1

for i in range(2, MAX + 1):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD


def f(r, c):
    return fac[r + c] * finv[r] * finv[c] % MOD


ans = 0
for i in range(c1, c2 + 1):
    ans += f(r2, i + 1) - f(r1 - 1, i + 1)
    ans %= MOD
print(ans)


### FIXED CODE ###

r1, c1, r2, c2 = map(int, input().split())

MAX = 2 * 10 ** 6 + 2
MOD = 10 ** 9 + 7

# Factorial
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1
for i in range(2, MAX + 1):
    fac[i] = fac[i - 1] * i % MOD
    
# Inverse factorial
finv = [0] * (MAX + 1)
finv[MAX] = pow(fac[MAX], MOD - 2, MOD)
for i in reversed(range(1, MAX + 1)):
    finv[i - 1] = finv[i] * i % MOD

def f(r, c):
    return fac[r + c] * finv[r] * finv[c]

ans = 0
for i in range(c1, c2 + 1):
    ans += f(r2, i + 1) - f(r1 - 1, i + 1)
    ans %= MOD
print(ans)
cardArray = list(map(int,input().split()))

if cardArray[0]== carArray[1]:
  print("Draw")
elif cardArray[0] < cardArray[1]:
  if cardArray[0] == 1:
    print("Alice")
  else:
    print("Bob")
else:
  if cardArray[1] == 1:
    print("Bob")
  else:
    print("Alice")


### FIXED CODE ###

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

if cardArray[0]== cardArray[1]:
  print("Draw")
elif cardArray[0] < cardArray[1]:
  if cardArray[0] == 1:
    print("Alice")
  else:
    print("Bob")
else:
  if cardArray[1] == 1:
    print("Bob")
  else:
    print("Alice")
from fractions import gcd
#from math import gcd
#import numpy as np
import sys
input = sys.stdin.readline
mod=10**9+7

N = int(input())
A = list(map(int, input().split()))

lcms=[A[0]]
[lcms.append(s*lcms[-1]//gcd(lcms[-1], s)) for s in A]
lcm=lcms[-1]

ans=np.sum([lcm*pow(s, mod-2, mod) %mod  for s in A]) % mod

print(int(ans))

### FIXED CODE ###

from fractions import gcd
#from math import gcd
import numpy as np
import sys
input = sys.stdin.readline
mod = 10**9+7

N = int(input())
A = list(map(int, input().split()))

lcm = 1
for s in A:
    lcm = s*lcm//gcd(lcm, s)

ans = lcm*sum([pow(s, mod-2, mod) for s in A]) % mod
#ans = sum([lcm//s % mod for s in A]) % mod

print(int(ans%mod))
s = input()
t = s[1]
s = s[0]
count = 0
for i in range(3):
	if s[i] == t[i]:
		count += 1

print(count)

### FIXED CODE ###

s = input()
t = input()
count = 0
for i in range(3):
	if s[i] == t[i]:
		count += 1

print(count)
from collections import deque
import sys
sys.setrecursionlimit(1000000)
h,w=map(int, input().split())  
s=[list(input()) for i in range(h)]
v=[]
def bfs():
    d = [[float("inf")] * w for i in range(h)]
    que = deque([])
    #黒だったらスタートキューに入れる
    for i in range(w):
        for j in range(h):
            if s[i][j]=='#':
                que.append((i, j))
                d[i][j]=0
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
    
    
    while que:
        p = que.popleft()
         # 黒にする4方向をループ
        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]

            if 0<=nx<w and 0<=ny<h and s[nx][ny] != "#" and d[nx][ny] == float("inf"):
                que.append((nx, ny))
                d[nx][ny] = d[p[0]][p[1]] + 1
                
    for i in range(h):
        v.append(max(d[i]))
    return max(v)
res=bfs()
print(res)

### FIXED CODE ###

from collections import deque
 
h, w = map(int, input().split())
s = [input() for i in range(h)]
 
d = [[h+w for j in range(w)] for i in range(h)]
que = deque()
 
#黒だったらスタートキューに入れる
for i in range(h):
  for j in range(w):
    if s[i][j]=='#':
        que.append((i, j))
        d[i][j] = 0
 
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
 
 
while que:
    p = que.popleft()
    # 黒にする4方向をループ
    for i in range(4):
        nx = p[1] + dx[i]
        ny = p[0] + dy[i]
 
        if (0<=nx<w) and (0<=ny<h) and (d[ny][nx]==h+w):
            que.append((ny, nx))
            d[ny][nx] = d[p[0]][p[1]] + 1
 
res = max(map(max, d))
print(res)
from math import gcd
MOD = 10**9 + 7
H, W, T = map(int, input().split())
ga, gb = gcd(H, T), gcd(W, T)
H //= ga
W //= gb
ans = (pow(2, H, MOD) + pow(2, W, MOD) - 1 + pow(2, gcd(H, W)) - 2) % MOD
print(pow(ans, ga*gb, MOD))


### FIXED CODE ###

from fractions import gcd
MOD = 10**9 + 7
H, W, T = map(int, input().split())
ga, gb = gcd(H, T), gcd(W, T)
H //= ga
W //= gb
ans = (pow(2, H, MOD) + pow(2, W, MOD) - 1 + pow(2, gcd(H, W)) - 2) % MOD
print(pow(ans, ga*gb, MOD))
n = input()
A = list(map(int, input().split()))
cnt = 0
while all(a % 2 == 0 for a in A):
    A=[a / 2 for a in A]
    ans += 1
print(ans)

### FIXED CODE ###

n = input()
A = list(map(int, input().split()))
cnt = 0
while all(a % 2 == 0 for a in A):
    A = [a / 2 for a in A]
    cnt += 1
print(cnt)
import math


def main():
    import collections
    import numpy as np

    N = int(input())
    A = np.array(list(map(int, input().split())))

    As = np.tile(A, (N, 1))

    for i, A in enumerate(As):
        A[i] = 0
        tmp_A = collections.Counter(A)
        su = 0
        for pairs in sorted(tmp_A.values(), reverse=True):
            if pairs >= 2:
                su += combinations_count(pairs, 2)
            else:
                break
        print(su)


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


if __name__ == '__main__':
    main()


### FIXED CODE ###



def main():
    import collections

    N = int(input())
    A = list(map(int, input().split()))

    allc = collections.Counter(A)
    # all_list = [0]*N
    allsu = 0
    for pairs in sorted(allc.values(), reverse=True):
        allsu += pairs*(pairs-1)//2

    for a in A:
        num = allc[a]
        print(allsu - (num-1))

    # for i in range(N):
    #     x = A[i]
    #     A[i] = 0
    #     tmp_A = cc(A)
    #     su = 0
    #     for pairs in sorted(tmp_A.values(), reverse=True):
    #         if pairs >= 2:
    #             su += pairs*(pairs-1)//2
    #         else:
    #             break
    #     A[i] = x
    #     print(su)


if __name__ == '__main__':
    main()
n,q=map(int,input().split())
s=list(input())
li=[0]*n

for i in range(n):
  if i==0:
    continue
  if s[i-1]=="A" and s[i]=="T":
    li[i]=1

for i in range(q):
  l,r=map(int,input())
  tmp=li[l:r]
  print(sum(temp))


### FIXED CODE ###

n,q=map(int,input().split())
s=list(input())
li=[0]*n
cnt=0
ans=0

for i in range(n):
  if i==0:
    continue
  if s[i-1]=="A" and s[i]=="C":
    cnt+=1  
  li[i]=cnt
    
for i in range(q):
  l,r=map(int,input().split())
  ans=li[r-1]-li[l-1]
  print(ans)
a,b=map(int,input().split())
if a>b:
	print(a,">",b)
else if a==b:
	print(a,"==",b)
else if a<b:
	print(a,"<",b)

### FIXED CODE ###

a,b=map(int,input().split())
if a>b:
	print("a",">","b")
elif a==b:
	print("a","==","b")
elif a<b:
	print("a","<","b")
a, b, c = map(int, input().split())

if (5 in [a, b, c] and 7 in [a, b, c]) and a+b+c == 17:
  print("YES")
  else:
    print("NO")
  
  
  

### FIXED CODE ###

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

if a+b+c == 17 and (5 in [a,b,c] and 7 in [a,b,c]):
    print("YES")
else:
    print("NO")
k = int(input())
a, b = int(input())
if k<=b-a+1:
  print("OK")
  else:
    print("NG")

### FIXED CODE ###

K = int(input())
A, B = map(int,input().split())
 
 
if A // K == B // K:
    if A % K ==0:
        print('OK')
    else:
        print('NG')  
else:
    print('OK')
import math

def lcm(x,y):
    return (x*y)//math.gcd(x,y)

a,b=map(int,input().split())
ans=lcm(a,b)
print(ans)

### FIXED CODE ###

import fractions

def lcm(x,y):
    return (x*y)//fractions.gcd(x,y)

a,b=map(int,input().split())
ans=lcm(a,b)
print(ans)
x = list(sorted(range(input()), key=int, reverse=True))
for b in x:
	for p in x:
		if b**p <= x[0] and p>=2 and b>=1:
			break
	if b**p <= x[0] and p>=2 and b>=1:
		print(b**p)
		break

### FIXED CODE ###

a,b,c,d = map(int,raw_input().split())
x = max(a,c)-min(a,c)
if d >= x :
	print('Yes')
elif (max(a,b)-min(a,b)) <= d and (max(b,c)-min(b,c)) <= d :
	print('Yes')
else:
	print('No')
print(S[0] + (S.length()-2) + S[-1])

### FIXED CODE ###

s = input()
print(s[0] + str(len(s)-2) + s[-1])
s=input()
t=input()

print(t+s, sep="")

### FIXED CODE ###

s,t=map(str,input().split())
# t=input()

print(t+s, sep="")
n = int(input())
a = [[] for i in range(n)]
for i in range(n):
    a[i] = list(map(int,input().split()))
    for j in range(n-1):
        a[i][j] -= 1
    a[i].reverse()
q = []

def check(i):
    if len(a[i]) == 0:
        return 
    j = a[i][-1]
    if len(a[j]) == 0:
        return
    if a[j][-1] == i:
        q.append([min(i,j), max(i,j)])
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

for i in range(n):
    check(i)
day = 0
while (len(q) > 0):
    day += 1
    prevQ = q.copy()
    prevQ = get_unique_list(prevQ)
    q = []
    for i,j in prevQ:
        a[i].pop()
        a[j].pop()
    for i,j in prevQ:
        check(i)
        check(j)
for i in range(n):
    if len(a[i]) > 0:
        print(-1)
        exit()
print(day)

### FIXED CODE ###

n = int(input())
a = [[] for i in range(n)]
for i in range(n):
    a[i] = list(map(int,input().split()))
    for j in range(n-1):
        a[i][j] -= 1
    a[i].reverse()
q = []

def check(i):
    if len(a[i]) == 0:
        return 
    j = a[i][-1]
    if len(a[j]) == 0:
        return
    if a[j][-1] == i:
        q.append([min(i,j), max(i,j)])
for i in range(n):
    check(i)
day = 0
while (len(q) > 0):
    day += 1
    prevQ = list(map(list, set(map(tuple, q))))
    q = []
    for i,j in prevQ:
        a[i].pop()
        a[j].pop()
        check(i)
        check(j)
for i in range(n):
    if len(a[i]) > 0:
        print(-1)
        exit()
print(day)
n,m = map(int, input().split())
a = [int(input()) for i in range(m)]
a.append(n)
a.insert(0, 0)

def nCr(n, r):
  num = 1
  for i in range(r+1, n+1):
    num *= i
  return num


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

for i in range(1, m+2):
  step = a[i] - a[i-1] - 1
  pattern = 1
  for j in range(1, int(step/2+1)):
    pattern += nCr(step-j, j)
  P *= pattern 

print(P%1000000007)


### FIXED CODE ###

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

print(sum(h)-max(h))
n = raw_input()
A = map(int, raw_input().split())
q = raw_input()
m = map(int, raw_input().split())

def solve(i, m):
 if m == 0:
  return true
 if i >= n and m > 0:
  return false
 res = solve(i + 1, m) or solve(i + 1, m - A[i])
 return res

for j in range(0, q):
 if m == solve(0, m[j]):
  print "yes"
 else:
  print "no"

### FIXED CODE ###

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

def solve(i, m):
 if m == 0:
  return True
 if i >= n or m > sum(A):
  return False
 res = solve(i+1, m) or solve(i+1, m-A[i])
 return res

for j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from math import gcd

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    
    if K > A[N-1]:
        print('IMPOSSIBLE')
    else:
        ans = 0
        for i in range(N):
            ans = gcd(ans,A[i])
            if ans == 1:
                print('POSSIBLE')
                exit()
        if (A[N-1]-K)%ans == 0:
            print('POSSIBLE')
        else:
            print('IMPOSSIBLE')


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from fractions import gcd

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    
    if K > A[N-1]:
        print('IMPOSSIBLE')
    else:
        ans = 0
        for i in range(N):
            ans = gcd(ans,A[i])
            if ans == 1:
                print('POSSIBLE')
                exit()
        if (A[N-1]-K)%ans == 0:
            print('POSSIBLE')
        else:
            print('IMPOSSIBLE')


if __name__ == "__main__":
    main()
s, t = input().split()
print("Yes" if s == t[:-1] else "No")


### FIXED CODE ###

s = input()
t = input()
print("Yes" if s == t[:-1] else "No")
a, b, c, k = [int(e) for e in input().split()]

import numpy as np

all = np.zeros(a+b+c)
all[:a] +=1
all[-c:] -=1

print(int(sum(all[:a+b])))

### FIXED CODE ###

a, b, c, k = [int(e) for e in input().split()]

count=0

if k <= a:
    count +=k
elif k <= a+b:
    count +=a
else:
    count = 2*a + b - k

print(count)
n, k = map(int, input().split())
s = input()
c = 1
l = []
l += [0,0] if (s[0] == '0') else [0]
for i in range(1, n):
    if s[i-1] != s[i]: l += [c+l[-1]]; c = 1; else: c +=1
l += [c+l[-1]]
if s[-1] == '0': l += [l[-1]]
ll = len(l)
pl = 2 * k + 1
if ll <= pl: print(n)
else: m = 0
   for i in range(0, ll-pl+1, 2): t = l[pl+i]-l[i]; m = t if (t > m) else m
   print(m)
  

### FIXED CODE ###

n, k = map(int, input().split())
s = input()
c = 1
l = []

if s[0] == '0':
    l.append(0)

for i in range(1, n):
    if s[i-1] != s[i]:
        l.append(c)
        c = 1
    else: 
        c +=1
l.append(c)

if s[n-1] == '0':
    l.append(0)

ll = len(l)
pl = 2 * k + 1

if ll <= pl:
    t = 0
    for i in range(ll):
        t += l[i]
    print(t)
else:
    t = 0
    for i in range(0,pl):
      t += l[i]
    m = t
    for i in range(0, ll-pl, 2):
        t += l[pl+i] + l[pl+i+1]
        t -= l[   i] + l[   i+1]
        m = t if (t > m) else m
    print(m)
from functools import*
@lru_cache(None)
def s(l,r):
  if r-l<2:return 0
  return min(s(l,i)+s(i,r)for i in range(l+1,r))+a[r-1]-a[l-1]
n,*a=map(int,open(0).read().split())
for i in range(n-1):a[i+1]+=a[i]
a+=[0]
print(s(0,n))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
def main():
  def s(l,r):
    k=l*n+r
    if d[k]:return d[k]
    if r-l<2:return 0
    d[k]=t=min(s(l,i)+s(i,r)for i in range(l+1,r))+a[r-1]-a[l-1]
    return t
  n,*a=map(int,open(0).read().split())
  d=[None]*(n*n+1)
  for i in range(n-1):a[i+1]+=a[i]
  a+=[0]
  print(s(0,n))
main()
#!/usr/bin/env python3
N = int(input())
X = input()

x_num = int(X, 2)
cnt1 = X.count('1')

p_zero = x_num % (cnt1 + 1)
p_one = x_num % (cnt1 - 1)


def f(cnt):
    if (cnt > 0):
        pcount = p_count(cnt)
        return f(cnt % pcount) + 1
    else:
        return 0


def p_count(x):
    cnt = 0
    while (x > 0):
        if x % 2 != 0:
            cnt += 1
        x //= 2
    return cnt


def f1(x):
    cnt = 0
    while (x > 0):
        x %= bin(x).count('1')
        cnt += 1
    return cnt


for i, x in enumerate(list(X)):
    if (x == '1'):
        #x_num = int(''.join(X), 2)
        if (x_num - (2**(N-(i+1)))) != 0:
            print(f1((p_one - pow(2, (N - (i + 1)), cnt1 - 1)) % (cnt1 - 1)) + 1)
        else:
            print(0)
    else:
        #x_num = int(''.join(X), 2)
        print(f1((p_zero + pow(2, (N - (i + 1)), cnt1 + 1)) % (cnt1 + 1)) + 1)

### FIXED CODE ###

#!/usr/bin/env python3
N = int(input())
X = input()

x_num = int(X, 2)
cnt1 = X.count('1')

p_zero = x_num % (cnt1 + 1)
p_one = (x_num % (cnt1 - 1) if cnt1 - 1 > 0 else 1)


def f(cnt):
    if (cnt > 0):
        pcount = p_count(cnt)
        return f(cnt % pcount) + 1
    else:
        return 0


def p_count(x):
    cnt = 0
    while (x > 0):
        if x % 2 != 0:
            cnt += 1
        x //= 2
    return cnt


def f1(x):
    cnt = 0
    while (x > 0):
        x %= bin(x).count('1')
        cnt += 1
    return cnt


for i, x in enumerate(list(X)):
    if (x == '1'):
        #x_num = int(''.join(X), 2)
        if cnt1 - 1 > 0:
            xxx = (p_one - pow(2, (N - (i + 1)), cnt1 - 1)) % (cnt1 - 1)
            xxx += cnt1 - 1 if xxx < 0 else 0
            print(f1(xxx) + 1)
        else:
            print(0)
    else:
        #x_num = int(''.join(X), 2)
        xxx = (p_zero + pow(2, (N - (i + 1)), cnt1 + 1)) % (cnt1 + 1)
        xxx += cnt1 + 1 if xxx < 0 else 0
        print(f1(xxx) + 1)
x,y = map(int,input().split())
if 2*x <= y <= 4x and y %2 =0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x,y = map(int,input().split())
if 2*x <= y <= 4*x and y %2 == 0:
  print("Yes")
else:
  print("No")
# -*- coding: utf-8 -*-

import sys
import os
import math

# refs
# https://shikousakugo.wordpress.com/2012/06/27/ray-intersection-2/

def det(a, b, c):
    return + a[0] * b[1] * c[2] \
           + a[2] * b[0] * c[1] \
           + a[1] * b[2] * c[0] \
           - a[2] * b[1] * c[0] \
           - a[1] * b[0] * c[2] \
           - a[0] * b[2] * c[1]

def sub(v0, v1):
    # v0 - v1
    return (v0[0] - v1[0], v0[1] - v1[1], v0[2] - v1[2])

# me
p0 = list(map(int, input().split()))

# enemy
p1 = list(map(int, input().split()))

# barrier
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

a = sub(p1, p0)
b = sub(A, B)
c = sub(A, C)
d = sub(A, p0)

EPS = 0.0000001
lower = -EPS
upper = 1 + EPS

denom = det(a, b, c)

if denom > lower:
    t = det(d, b, c) / denom
    u = det(a, d, c) / denom
    v = det(a, b, d) / denom

    # i am on barrier
    if -EPS < t < EPS:
        print('HIT')

    # barrier is not between ours
    elif t < 0:
        print('HIT')

    # hit barrier
    elif lower < t < upper and lower <= u <= upper and lower <= v <= upper and lower <= u + v <= upper:
        print('MISS')

    else:
        print('HIT')
else:
    print('HIT')

### FIXED CODE ###

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

import sys
import os
import math
import random

# refs
# https://shikousakugo.wordpress.com/2012/06/27/ray-intersection-2/

def det(a, b, c):
    return + a[0] * b[1] * c[2] \
           + a[2] * b[0] * c[1] \
           + a[1] * b[2] * c[0] \
           - a[2] * b[1] * c[0] \
           - a[1] * b[0] * c[2] \
           - a[0] * b[2] * c[1]

def sub(v0, v1):
    # v0 - v1
    return (v0[0] - v1[0], v0[1] - v1[1], v0[2] - v1[2])

# me
p0 = list(map(int, input().split()))

# enemy
p1 = list(map(int, input().split()))

# barrier
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

a = sub(p1, p0)
b = sub(A, B)
c = sub(A, C)
d = sub(A, p0)

EPS = 0.0000001
lower = -EPS
upper = 1 + EPS

denom = det(a, b, c)

if denom != 0:
    t = det(d, b, c) / denom
    u = det(a, d, c) / denom
    v = det(a, b, d) / denom

    if t < lower:
        print('HIT')

    # hit barrier
    elif lower < t < upper and lower <= u <= upper and lower <= v <= upper and lower <= u + v <= upper:
        print('MISS')

    else:
        print('HIT')
else:
    print('HIT')
n=int(input())
m=int(input())
ans = (((n*(n-1))+(m*(m-1)))//2
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
 
ans = ((n*(n-1))+(m*(m-1)))//2
 
print(ans)
class Tree:
    def __init__(self, N):
        self.N = N
        self.nodes = [ Node(i) for i in range(N) ]

    def get_root(self, node):
        if node.parent is None:
            return node
        root = self.get_root(node.parent)
        node.parent = root
        return root

    def merge(self, n1, n2):
        node1 = self.nodes[n1]
        node2 = self.nodes[n2]

        root1 = self.get_root(node1)
        root2 = self.get_root(node2)

        if root1.ID == root2.ID:
            return

        root1.parent = root2

    def get_root_count(self):
        count = 0
        for n in self.nodes:
            if n.parent is None:
                count += 1
        return count

class Node:
    def __init__(self, ID):
        self.ID = ID
        self.parent = None

def main():
    N, M = map(int, input().split())
    tree = Tree(N)
    for i in range(M):
        A, B = map(int, input().split())
        tree.merge(A, B)
    print(tree.get_root_count() - 1)


main()


### FIXED CODE ###

class Tree:
    def __init__(self, N):
        self.N = N
        self.nodes = [ Node(i) for i in range(N) ]

    def get_root(self, node):
        if node.parent is None:
            return node
        root = self.get_root(node.parent)
        node.parent = root
        return root

    def merge(self, node1, node2):
        root1 = self.get_root(node1)
        root2 = self.get_root(node2)

        if root1.ID == root2.ID:
            return

        root1.parent = root2

    def get_root_count(self):
        count = 0
        for n in self.nodes:
            if n.parent is None:
                count += 1
        return count

class Node:
    def __init__(self, ID):
        self.ID = ID
        self.parent = None

def main():
    N, M = map(int, input().split())
    tree = Tree(N)
    for i in range(M):
        A, B = map(int, input().split())
        A, B = A-1, B-1
        tree.merge(tree.nodes[A], tree.nodes[B])
    print(tree.get_root_count() - 1)


main()