Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N, C = list(map(int, input().split()))
tmax = 0
s = [0 for _ in range(N)]
t = [0 for _ in range(N)]
c = [0 for _ in range(N)]
for i in range(N):
    s[i], t[i], c[i] = list(map(int, input().split()))
    if t[i] >= tmax:
        tmax = t[i]

c_timeline = [[0 for _ in range(C)] for _ in range(2*tmax + 1)]
for i in range(N):
    for j in range(2*s[i]-1, 2*t[i]+1):
        c_timeline[j][c[i]-1] = 1

rokuga = 0
for timeline in c_timeline:
    time = sum(timeline)
    if rokuga < time:
        rokuga = time

print(rokuga)


### FIXED CODE ###

N, C = list(map(int, input().split()))
tmax = 0
s = [0 for _ in range(N)]
t = [0 for _ in range(N)]
c = [0 for _ in range(N)]
for i in range(N):
    s[i], t[i], c[i] = list(map(int, input().split()))

tmax = max(t)
c_timeline = [[0]*C for _ in range(2 * tmax + 1)]
for i in range(N):
    S = s[i]
    T = t[i]
    channel = c[i] - 1
    for j in range(2 * S - 1, 2 * T + 1):
        c_timeline[j][channel] = 1

rokuga = 0
for timeline in c_timeline:
    time = sum(timeline)
    if rokuga < time:
        rokuga = time

print(rokuga)
### BUGGY CODE ###

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

# DP
INF = int(1e10)
dp = [INF] * N
dp[0] = 0


for i in range(1, N):
    for j in range(1, K+1):
        if i-j >= 0:
            dp[i] = min(dp[i], dp[i-j] + abs(h[i] - h[i-j]))
print(dp[N-1])

### FIXED CODE ###

# Educational DP Contest B-Frog 2

def frog(N, K, h):
    # initialize
    inf = float('inf')
    dp = [inf] * N
    
    minKN = min(K, N)
    for i in range(minKN):
        if i == 0:
            dp[i] = 0
        else: 
            dp[i] = abs(h[0] - h[i])
            for j in range(minKN):
                if j == i:
                    continue
                elif j < i:
                    dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]))
    # DP
    for i in range(N):
        if i == 0:
            continue
        elif i < K:
            continue
        else:
            dp[i] = min([abs(h[k] - h[i]) + dp[k] for k in range(i-K, i)])
    return dp[N-1]
    
if __name__ == "__main__":
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    print(frog(N, K, h))
### BUGGY CODE ###

from collections import deque

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

tmp = deque([0])

res = 0
while True:
    if tmp:
        now = tmp.popleft()
        
        if now + 1 <= N:
            
            if now + 1 == N:
                res += 1
                
            elif now + 1 in A:
                pass
            
            else:
                tmp.append(now + 1)
                
            
        if now + 2 <= N:
            
            if now + 2 == N:
                res += 1
                
            elif now + 2 in A:
                pass
            
            else:
                tmp.append(now + 2)
            
    else:
        break
            
print(res%(10 ** 9 + 7))
            
        

### FIXED CODE ###

from collections import deque

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

tmp = [0 for _ in range(N + 1)]

now = 0
if 1 not in A:
    tmp[1] = 1
    
else:
    now += 1
    
if (2 not in A) and N >= 2:
    tmp[2] = tmp[1] + 1
    
else:
    now += 1

for i in range(3, N+1):
    
    try:
        if i != A[now]:
            tmp[i] = tmp[i-1] + tmp[i-2] 
            
        else:
            now += 1
        
    except:
        tmp[i] = tmp[i-1] + tmp[i-2] 

    
print(tmp[-1]%(10**9+7))
### BUGGY CODE ###

N = int(input())
X_list = list(map(int, input().split()))
idx_value = []

for idx, v in enumerate(X_list, 1):
    idx_value.append((idx, v,))

i_list = [i for i in range(1, N + 1)]
idx_value_copy = idx_value.copy()
idx_value_copy.sort(key=lambda x: x[1])
li_list = []
for t in idx_value:
    for idx, t_c in enumerate(idx_value_copy, 1):
        if t_c[0] == t[0] and t_c[1] == t[1]:
            li_list.append(idx)
            break

median_idx = int(N / 2)
median_left = idx_value_copy[median_idx - 1][1]
median_right = idx_value_copy[median_idx][1]
for i in li_list:
    if i <= median_idx:
        print(median_right)
    else:
        print(median_left)


### FIXED CODE ###

N = int(input())
X_list = list(map(int, input().split()))
X_list_copy = X_list.copy()
X_list_copy.sort()

median_idx = int(N / 2)
left_num = X_list_copy[median_idx - 1]
right_num = X_list_copy[median_idx]

for x in X_list:
    if x < right_num:
        print(right_num)
    else:
        print(left_num)
### BUGGY CODE ###

import fractions
from collections import defaultdict
N, M = list(map(int, input().split()))
S = input()
T = input()

L = int(N * M / fractions.gcd(N, M))
LN = int(L / N)
LM = int(L / M)

count = 0
dic1 = defaultdict(int)
dic2 = defaultdict(int)
for n in range(N):
    dic1[LN*n] = S[n]

for n in range(M):
    dic2[LM*n] = T[n]

for n in range(L):
    if dic1[n] != 0 and dic2[n] != 0 and dic1[n] != dic2[n]:
        count += 1
        break

if count == 0:
    print(L)
else:
    print('-1')




### FIXED CODE ###

import fractions
N, M = list(map(int, input().split()))
S = input()
T = input()

L = int(N * M / fractions.gcd(N, M))
LN = int(L / N)
LM = int(L / M)

count = 0
dic1 = {LN*n:S[n] for n in range(N)}
dic2 = {LM*n:T[n] for n in range(M)}

for k in dic1.keys():
    if k in dic2 and dic1[k] != dic2[k]:
        count += 1
        print(-1)
        break

if count == 0:
    print(L)
### BUGGY CODE ###

k = int(input())


i = 1
s = '7'


while True:
    if k % 2 == 0:
        print('-1')
        exit()
    if int(s) % k == 0:
        print(str(i))
        exit()
    s += '7'
    i += 1


### FIXED CODE ###

k = int(input())

if k == 1:
    print('1')
    exit()
if k % 2 == 0 or k % 5 == 0:
    print('-1')
    exit()

k *= 9
a = 10
for i in range(10*k):
    if (7 * (a - 1 + k)) % k == 0:
        print(str(i+1))
        exit()
    a = (a*10) % k
### BUGGY CODE ###

from collections import defaultdict, deque, Counter

N = int(input())

edges = []
counter = Counter()
nodes = defaultdict(set)

for _ in range(N - 1):
    u, v = map(int, input().split(' '))
    counter[u] += 1
    counter[v] += 1
    nodes[u].add(v)
    nodes[v].add(u)
    edges.append((u, v))

K = max(counter.values())
colors = set([1 + k for k in range(K)])

node_colors = defaultdict(set)
checked = set()
queue = deque([1])
edge_colors = {}

while queue:
    u = queue.popleft()
    checked.add(u)
    for v, c in zip(nodes[u] - checked, colors - node_colors[u]):
        node_colors[u].add(c)
        node_colors[v].add(c)
        edge_colors[(min(u, v), max(u, v))] = c
        queue.append(v)

print(K)
for u, v in edges:
    print(edge_colors[(u, v)])


### FIXED CODE ###

from collections import defaultdict, deque, Counter

N = int(input())

counter = Counter()
nodes = defaultdict(list)
edges = []

for i in range(N - 1):
    u, v = map(int, input().split(' '))
    nodes[u].append((v, i))
    nodes[v].append((u, i))
    edges.append((u, v))

K = 0
for node in nodes.values():
    K = max(K, len(node))

checked = set()
queue = deque([(1, 0)])
edge_colors = [0] * N

while queue:
    u, uc = queue.popleft()
    checked.add(u)
    color = 1
    for v, e in nodes[u]:
        if v in checked:
            continue
        if color == uc:
            color += 1
        edge_colors[e] = color
        queue.append((v, color))
        color += 1

print(K)
for i in range(N - 1):
    print(edge_colors[i])
### BUGGY CODE ###

n, m = map(int, input().split())
a_l = [ int(input()) for _ in range(m) ]

dp = [0] * (n+1)
dp[0] = 1
if 1 not in a_l:
    dp[1] = 1
else:
    dp[1] = 0
if n > 1:
    if 2 not in a_l:
        dp[2] = dp[0] + dp[1]
    else:
        dp[2] = 0
    for i in range(2,n+1):
        if i not in a_l:
            dp[i] = (dp[i-1] + dp[i-2])%1000000007
        else:
            dp[i] = 0
print(dp[-1])

### FIXED CODE ###

n, m = map(int, input().split())
a_l = [ int(input()) for _ in range(m) ]

dp = [1] * (n+1)
dp[0] = 1
if 1 not in a_l:
    dp[1] = 1
else:
    dp[1] = 0
if n > 1:
    for i in a_l:
        dp[i] = 0
    if 2 not in a_l:
        dp[2] = dp[0] + dp[1]
    else:
        dp[2] = 0
    for i in range(2,n+1):
        if dp[i] != 0:
            dp[i] = (dp[i-1] + dp[i-2])%1000000007
print(dp[-1])
### BUGGY CODE ###

n = int(input())
for i in range(n):
    for j in range(n):
        if (i+1) / (j+1) == j+1:
            ans = i + 1
print(ans)

### FIXED CODE ###

n = int(input())
for i in range(n):
    if (i+1)**2 > n:
        break
    elif (i+1)**2 <= n:
        ans = (i + 1)**2
print(ans)
### BUGGY CODE ###

import queue

h,w=list(map(int,input().split()))
a=[input() for _ in range(h)]
#a[h][w]
direction=[[-1,0],[1,0],[0,-1],[0,1]]
visited=[[-1]*w for _ in range(h)]
q=queue.Queue()

#全ての黒マスをキューに入れる
for hi in range(h):
  for wi in range(w):
    if a[hi][wi]=="#":
      q.put([hi,wi])
      visited[hi][wi]=0

while not q.empty():
  ch,cw=q.get()
  for d in direction:
    nh=ch+d[0]
    nw=cw+d[1]
    #端からはみでない、まだ見てない白マス
    if nh>=0 and nw>=0 and nh<h and nw<w and visited[nh][nw]==-1:
      q.put([nh,nw])
      visited[nh][nw]=visited[ch][cw]+1

ans=0
for hi in range(h):
  tmp=max(visited[hi])
  if tmp > ans:
    ans=tmp
print(ans)


### FIXED CODE ###

import collections

h,w=list(map(int,input().split()))
a=[input() for _ in range(h)]
#a[h][w]
direction=[[-1,0],[1,0],[0,-1],[0,1]]
visited=[[-1]*w for _ in range(h)]
q=collections.deque()

#全ての黒マスをキューに入れる
for hi in range(h):
  for wi in range(w):
    if a[hi][wi]=="#":
      q.append([hi,wi])
      visited[hi][wi]=0

while len(q)>0:
  ch,cw=q.popleft()
  for d in direction:
    nh=ch+d[0]
    nw=cw+d[1]
    #端からはみでない、まだ見てない白マス
    if nh>=0 and nw>=0 and nh<h and nw<w and visited[nh][nw]==-1:
      q.append([nh,nw])
      visited[nh][nw]=visited[ch][cw]+1

ans=0
for hi in range(h):
  tmp=max(visited[hi])
  if tmp > ans:
    ans=tmp
print(ans)
### BUGGY CODE ###

import bisect
import sys
input = sys.stdin.readline

INF = 10**12
n, q = [int(item) for item in input().split()]
a = [int(item) for item in input().split()]

# Calc cumrative sum
sum_even = [0] * (n + 1)
sum_odd = [0] * (n + 1)
sum_all = [0] * (n + 1)
for i, item in enumerate(a):
    if i % 2 == 0:
        sum_odd[i+1] = sum_odd[i] + a[i]
        sum_even[i+1] = sum_even[i]
    else:
        sum_even[i+1] = sum_even[i] + a[i]
        sum_odd[i+1] = sum_odd[i]
    sum_all[i+1] = sum_all[i] + a[i]

# Iterate in query
a.append(INF)
ans = []
for i in range(q):
    x = int(input())
    # Get div of aoki - takahashi
    # l: aoki takes, r: takahashi takes
    l = 0; r = n - 1
    while r - l > 1:
        m = (r + l) // 2
        rng = abs(x - a[m])
        t_num = n - m
        a_num = n - t_num - (bisect.bisect_left(a, x - rng))
        if t_num <= a_num + 1:
            r = m
        else:
            l = m
    rng = abs(x - a[r])
    t_num = n - r
    rest = n - 2 * t_num
    t_sum = sum_all[n] - sum_all[n - t_num]
    a_sum = sum_all[r] - sum_all[r - t_num]

    # Add stripe area
    if n - t_num * 2 > 0:
        if rest % 2 == 0:
            t_sum += sum_even[rest]
            a_sum += sum_odd[rest]
        else:
            t_sum += sum_odd[rest]
            a_sum += sum_even[rest]
    ans.append(t_sum)

print("\n".join([str(item) for item in ans]))

### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline

INF = 10**12
n, q = [int(item) for item in input().split()]
a = [int(item) for item in input().split()]

# Calc cumrative sum
sum_even = [0] * (n + 1)
sum_odd = [0] * (n + 1)
sum_all = [0] * (n + 1)
for i, item in enumerate(a):
    if i % 2 == 0:
        sum_odd[i+1] = sum_odd[i] + a[i]
        sum_even[i+1] = sum_even[i]
    else:
        sum_even[i+1] = sum_even[i] + a[i]
        sum_odd[i+1] = sum_odd[i]
    sum_all[i+1] = sum_all[i] + a[i]

# Iterate in query
a.append(INF)
ans = []
for i in range(q):
    # Get div of aoki - takahashi
    x = int(input())
    big = bisect.bisect_left(a, x)
    small = big - 1
    if (x - a[small]) ** 2 <= (x - a[big]) ** 2:
        l = small
    else:
        l = big
    r = n - 1
    while r - l > 1:
        m = (r + l) // 2
        rng = abs(x - a[m])
        taka = n - m
        aoki = n - taka - (bisect.bisect_left(a, x - rng))
        if taka <= aoki + 1:
            r = m
        else:
            l = m
    rng = abs(x - a[r])
    taka = n - r
    aoki = n - taka - (bisect.bisect_left(a, x - rng))
    taka_sum = sum_all[n] - sum_all[n - taka]
    aoki_sum = sum_all[r] - sum_all[r - taka]
    rest = n - taka * 2
    if rest > 0:
        if rest % 2 == 0:
            taka_sum += sum_even[rest]
            aoki_sum += sum_odd[rest]
        else:
            taka_sum += sum_odd[rest]
            aoki_sum += sum_even[rest]

    ans.append(taka_sum)
print("\n".join([str(item) for item in ans]))
### BUGGY CODE ###

import sys
import io, os
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
from collections import Counter
from fractions import Fraction

N=int(input())
mod=10**9+7

S=[tuple(map(int,input().split())) for i in range(N)]

def main():
    C=Counter()
    PLUS=0
    for a,b in S:
        if a==0 and b==0:
            PLUS+=1
        elif b!=0:
            C[Fraction(a,b)]+=1
        else:
            C[float("inf")]+=1
        
    ANS=1

    for x in list(C.keys()):
        if x!=float("inf") and x!=Fraction(0,1):
            n=x.numerator
            d=x.denominator

            ANS=ANS*(pow(2,C[x],mod)+pow(2,C[Fraction(-d,n)],mod)-1)%mod

            C[x]=0
            C[Fraction(-d,n)]=0
            
        else:
            ANS=ANS*(pow(2,C[float("inf")],mod)+pow(2,C[Fraction(0,1)],mod)-1)%mod

            C[float("inf")]=0
            C[Fraction(0,1)]=0

    print((ANS-1+PLUS)%mod)

main()
    


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import Counter
from fractions import Fraction
from math import gcd

N=int(input())
mod=10**9+7

S=[tuple(map(int,input().split())) for i in range(N)]

def main():
    C=Counter()
    PLUS=0
    for a,b in S:
        if a==0 and b==0:
            PLUS+=1
        elif a==0:
            C[(0,1)]+=1
        elif b!=0 and a>0:
            C[(a//gcd(a,b),b//gcd(a,b))]+=1
        elif b!=0 and a<0:
            C[(-a//gcd(a,b),-b//gcd(a,b))]+=1
            
        else:
            C[float("inf")]+=1
        
    ANS=1

    #print(C)

    for x in list(C.keys()):
        if x!=float("inf") and x!=(0,1):

            a,b=x

            if b>0:
                ANS=ANS*(pow(2,C[x],mod)+pow(2,C[(b,-a)],mod)-1)%mod
                C[(b,-a)]=0
            else:
                ANS=ANS*(pow(2,C[x],mod)+pow(2,C[(-b,a)],mod)-1)%mod
                C[(-b,a)]=0
                
            C[x]=0

            
        else:
            ANS=ANS*(pow(2,C[float("inf")],mod)+pow(2,C[(0,1)],mod)-1)%mod

            C[float("inf")]=0
            C[(0,1)]=0

    print((ANS-1+PLUS)%mod)

main()
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
class sieve:
  def __init__(self, n):
    self.n = n
    self.sv = [1] * (n + 1)
    self.sv[0] = 0
    self.sv[1] = 0
    for i in range(2, n + 1):
      if self.sv[i]:
        for j in range(i * 2, n + 1, i):
          self.sv[j] = 0
  def isprime(self, x):
    if x > self.n:
      return False
    return self.sv[x] == 1
  def factorize(self, x):
    res = []
    for i in range(2, self.n + 1):
      if self.sv[i]:
        while x % i == 0:
          x //= i
          res.append(i)
    if x != 1:
      res.append(x)
    return res
  def modgcd(self, a, mod):
    res = [float("inf")] * (self.n + 1)
    vis = set()
    f = self.factorize(a[0])
    for j in f:
      res[j] = f.count(j)
      vis.add(j)
    for i in range(1, len(a)):
      f = self.factorize(a[i])
      for j in vis:
        res[j] = min(f.count(j), res[j])
        vis.add(j)
    rres = 1
    for i in range(self.n + 1):
      if res[i] != float("inf"):
        rres *= pow(i, res[i], mod)
        rres %= mod
    return rres
  def modlcm(self, a, mod):
    res = [0] * (self.n + 1)
    for i in range(len(a)):
      f = self.factorize(a[i])
      for j in f:
        res[j] = max(f.count(j), res[j])
    rres = 1
    for i in range(self.n + 1):
      if res[i] != 0:
        rres *= pow(i, res[i], mod)
        rres %= mod
    return rres
sv = sieve(10 ** 6)
lcm = sv.modlcm(a, 10 ** 9 + 7)
res = 0
for x in a:
  res += lcm * pow(x, 10 ** 9 + 5, 10 ** 9 + 7)
  res %= 10 ** 9 + 7
print(res)

### FIXED CODE ###

import sys
from fractions import gcd
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
l %= mod
for x in a:
  res += l * pow(x, mod - 2, mod)
  res %= mod
print(res)
### BUGGY CODE ###

n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = []

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    if count.count(a[i]) == 0:
      count.append(a[i])
  if h[a[i] - 1] >= h[b[i] - 1]:
    if count.count(b[i]) == 0:
      count.append(b[i])
      
print(n - len(count))

### FIXED CODE ###

n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = [0] * n

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    count[a[i] - 1] = 1
  if h[a[i] - 1] >= h[b[i] - 1]:
    count[b[i] - 1] = 1
      
print(count.count(0))
### BUGGY CODE ###

L, R = map(int, input().split())
mod = 2019
nums = list(set([i % 2019for i in range(L, R+1)]))

res = []
for i in range(len(nums)):
    for j in range(i+1, len(nums)):
       res.append((nums[i]*nums[j])%mod)
print(min(res))



### FIXED CODE ###

L, R = map(int, input().split())
mod = 2019
if (R-L+1) >= 2019:
    nums = [i for i in range(2019)]
else:
    nums = list(set([i % 2019for i in range(L, R+1)]))

res = []
for i in range(len(nums)):
    for j in range(i+1, len(nums)):
       res.append((nums[i]*nums[j])%mod)
print(min(res))
### BUGGY CODE ###

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

import sys

def isprime(n):
    for i in xrange(2, int(n**0.5)+1):
        if n % i == 0: return False
    return True

limit = 1000000
ansList = [0] # 1 is not prime
cnt = 0
for i in xrange(2, limit):
    if isprime(i): cnt += 1
    ansList.append(cnt)

#for line in ["999999"]:
for line in sys.stdin.readlines():
    List = map(int, line.strip().split())

    n = List[0]
    print ansList[n-1]

### FIXED CODE ###

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

import sys

limit = 1000000

prime01List = [1]*limit
prime01List[0] = 0 # 1 is not prime
for i in xrange(2, int(limit**0.5)+1):
    n = 2*i
    while(n <= limit):
        prime01List[n-1] = 0
        n += i


ansList = [0]*limit
cnt = 0
for i in xrange(limit):
    cnt += prime01List[i]
    ansList[i] = cnt


#for line in ["999999"]:
for line in sys.stdin.readlines():
    List = map(int, line.strip().split())

    n = List[0]
    print ansList[n-1]
### BUGGY CODE ###

### 動的計画法のテーブルを用意
# dp(n) は頂点nを始点として時の最大有効パスの長さ

def get_inputs():
    N, M = map(int, input().split())

    # グラフgを初期化
    g = [[] for _ in range(N)]

    # 辺情報を読み込みgに追加
    for _ in range(M):
        x, y = map(lambda c: int(c) - 1, input().split())
        g[x].append(y)

    return N, M, g


def getlp(x, depth):
    global dp, g

    if depth >= MAX_DEPTH:
        return -1
    elif dp[x] != -1:
        return dp[x]
    elif len(g[x]) == 0:
        dp[x] = 0
        return dp[x]
    else:
        mxp = 0
        for y in g[x]:
            yp = getlp(y, depth + 1)
            if yp == -1:
                return -1
            elif yp > mxp:
                mxp = yp
        dp[x] = mxp + 1
        return dp[x]


N, M, g = get_inputs()
MAX_DEPTH = 900

dp = [-1] * N
nodes = list(range(N))
ans = 0

while len(nodes) > 0:
    tmp_nodes = []
    for x in range(N):
        if dp[x] == -1:
            t = getlp(x, 0)
            if t == -1:
                tmp_nodes.append(x)
            else:
                ans = max(ans, t)
        else:
            ans = max(ans, dp[x])

    nodes = list(tmp_nodes)

print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

def get_inputs():
    N, M = map(int, input().split())
    
    # グラフgを初期化
    g = [[] for _ in range(N)]
    
    # 辺情報を読み込みgに追加
    for _ in range(M):
        x, y = map(lambda c: int(c) - 1, input().split())
        g[x].append(y)
    
    return N, M, g


def getlp(x):
    global dp, g
    
    if dp[x] != -1:
        return dp[x]
    elif len(g[x]) == 0:
        dp[x] = 0
        return dp[x]
    else:
        dp[x] = max([getlp(y) for y in g[x]]) + 1
        return dp[x]


N, M, g = get_inputs()

dp = [-1] * N
ans = 0
for x in range(N):
    ans = max(ans, getlp(x))

print(ans)
### BUGGY CODE ###

N, K ,Q = list(map(int, input().split()))
Point = [K for n in range(N)]
for q in range(Q):
    A = int(input()) - 1
    for n in range(N):
        if n == A:
            Point[n] += 0
        else:
            Point[n] -= 1

for n in range(N):
    if Point[n] > 0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

N, K ,Q = list(map(int, input().split()))
Point = [K for n in range(N)]
for q in range(Q):
    A = int(input()) - 1
    Point[A] += 1

for n in range(N):
    if Point[n] - Q > 0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

import fractions

k=int(input())
tot=0

for i in range(1,k+1):
    for j in range(1,k+1):
        for m in range(1,k+1):
            ans=i
            ans=fractions.gcd(ans,j)
            ans=fractions.gcd(ans,m)
            tot+=ans
print(tot)

### FIXED CODE ###

import math
k= int(input())
tot= 0
for i in range(1, k+1):
    for j in range(1, k+1):
        m = math.gcd(i,j)
        for n in range(1, k+1):
            l = math.gcd(m,n)
            tot += l
print(tot)
### BUGGY CODE ###

A,B,K = map(int,input().split())
for i in range(K):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1
print(A,B)

### FIXED CODE ###

A,B,K = map(int,input().split())
if A >= K:
  print(A-K,B)
elif B + A - K >= 0:
  print(0,B+A-K)
else:
  print(0,0)
### BUGGY CODE ###

S = input()

MOD = 10 ** 9 + 7
N = len(S)
dp = [[0] * 4 for _ in range(N + 1)]
dp[-1][-1] = 1

for i in reversed(range(N)):
    for j in reversed(range(3)):
        m1 = 3 if S[i] == '?' else 1
        m2 = 1 if S[i] == '?' or S[i] == 'ABC'[j] else 0
        dp[i][j] = m1 * dp[i + 1][j] + m2 * dp[i + 1][j + 1] % MOD
    
    # j == 3
    m = 3 if S[i] == '?' else 1
    dp[i][3] = m * dp[i + 1][3] % MOD
            
print(dp[0][0] % MOD)




### FIXED CODE ###

S = input()

MOD = 10 ** 9 + 7
N = len(S)
dp = [[0] * 4 for _ in range(N + 1)]
dp[-1][-1] = 1

for i in reversed(range(N)):
    m = 3 if S[i] == '?' else 1
    for j in reversed(range(3)):
        dp[i][j] = m * dp[i + 1][j]
        if S[i] == '?' or S[i] == 'ABC'[j]:
            dp[i][j] += dp[i + 1][j + 1]
        dp[i][j] %= MOD
    
    # j == 3
    dp[i][3] = m * dp[i + 1][3] % MOD
            
print(dp[0][0] % MOD)
### BUGGY CODE ###

n=int(input())
s=str(input())
s=list(s)
import collections
c=collections.Counter(s)
values, counts = zip(*c.most_common())
temp=list(counts)
l=len(temp)
ans=0
for i in range(2**l):
  tt=1
  for j in range(l):
    if ((i >> j) & 1):
      tt=tt*temp[j]
  ans=(ans+tt)%(10**9+7)
print((ans-1)%(10**9+7))

### FIXED CODE ###

n=int(input())
s=str(input())
s=list(s)
import collections
c=collections.Counter(s)
values, counts = zip(*c.most_common())
temp=list(counts)
l=len(temp)
ans=1
for i in range(l):
  ans=ans*(temp[i]+1)
print((ans-1)%(10**9+7))