Harryxun/stf_run huggingface dataset:
from collections import defaultdict
# 深さ優先探索
def dfs(x, seen):
  seen.add(x)
  for i in G[x]:
    if i in seen:
      continue
    dfs(i, seen)

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

# Graph構造を作らないといけない。
G = defaultdict(list)
for _ in range(M):
  A, B = map(int, input().split())
  G[A-1].append(B-1)
  G[B-1].append(A-1)
#print(G)

R = defaultdict(set)
for i in range(N):
  seen = set()
  dfs(i, seen)
  # 友達候補リストの作成
  R[i] = seen - set(G[i]) - set([i])
  #探索の都合で自分自身も入る。
  #すでに友達の要素は除外する。
#print(R)

#ブロックリストの反映
for _ in range(K):
  C, D = map(int, input().split())
  R[C-1].discard(D-1)
  R[D-1].discard(C-1)

#要素数が友達候補になる。
s = ''
for i in range(N):
  s += '{} '.format(len(R[i]))
print(s[:-1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)

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

Friend = [[] for i in range(N)]
for _ in range(M):
  A, B = map(int, input().split())
  Friend[A-1].append(B-1)
  Friend[B-1].append(A-1)

Block = [set() for i in range(N)]
for _ in range(K):
  C, D = map(int, input().split())
  Block[C-1].add(D-1)
  Block[D-1].add(C-1)


def dfs(x):
    if seen[x] == 0:
        R[cnt].add(x)
        seen[x]=1
        for i in Friend[x]:
            dfs(i)

seen = [0]*N
cnt  = 0
R    = []
for i in range(N):
    if seen[i] == 0:
        R.append(set())
        dfs(i)
        cnt += 1

seq = [0]*N

for r in R:
    lr = len(r)
    for j in r:
        seq[j] = lr - len(Friend[j]) - len(r&Block[j]) - 1

print(*seq)
a,b = map(int, input().split())

if a*b ==2:
    print(3)
elif a*b ==3:
    print(2)
else:
    print(1)

### FIXED CODE ###

a = int(input())
b = int(input())

if a*b ==2:
    print(3)
elif a*b ==3:
    print(2)
else:
    print(1)
N = int(input())

point = []
dist = []

for _ in range(N) :
    x, y = map(int, input().split())
    point.append((x, y))
    dist.append(abs(x) + abs(y))

maxDist = dist[-1]
mask = maxDist % 2

for d in dist :
    if d % 2 != mask :
        print('-1')
        break
    maxDist = max(maxDist, d)
else :  # 実現可能
    print(maxDist) # 腕の数
    out = [1] * maxDist
    print(*out)

    for i, (x, y) in enumerate(point) :
        if x < 0 :
            holizon = ['L'] * abs(x)
        elif x > 0 :
            holizon = ['R'] * abs(x)
        else :
            holizon = ['']

        if y < 0 :
            vertical = ['D'] * abs(y)
        elif y > 0 :
            vertical = ['U'] * abs(y)
        else :
            vertical = ['']

        R = (maxDist - dist[i]) // 2
        if R > 0 :
            last = ['LR'] * R
        else :
            last = ['']

        print(''.join(holizon + vertical + last))




### FIXED CODE ###

N=int(input())

point = []
parity = {}
for _ in range(N) :
    x, y = map(int, input().split())
    point.append((x, y))
    parity[(x + y) % 2] = 1

if len(set(parity)) == 2 :
    print('-1')
else :
    m = 38
    parity = 1 if (1 in parity) else 0
    print(m + 1 - parity)
    if parity == 1 :  # 距離が奇数
        print(*[1 << i for i in range(m)])
    else :
        print(1, *[1 << i for i in range(m)])

    def arm(x, y, m) :
        if abs(x) >= abs(y) :
            if x >= 0 :
                return ('R', x - (1<<m), y)
            else :
                return ('L', x + (1<<m), y)
        else :
            if y >= 0 :
                return ('U', x, y - (1<<m))
            else :
                return ('D', x, y + (1<<m))

    for x, y in point :
        ans = []
        for i in range(m-1, -1, -1) :
            mode, x, y = arm(x, y, i)
            ans.append(mode)
        if parity == 0 :  # 偶数の場合一つ足す
            if x == 1 :
                ans.append('R')
            elif x == -1 :
                ans.append('L')
            elif y == 1 :
                ans.append('U')
            elif y == -1 :
                ans.append('D')
        print(''.join(ans[::-1]))
import numpy as np
S = input()
b_num = S.count('B')
w_num = len(S) - b_num
end = 2**(w_num + 1) - 1
start = 0
for i in range(len(S)):
  if S[i] = 'W':
    start += np.power(2, i)
print(np.log2(start / end))

### FIXED CODE ###

S = input()
num, cnt = 0, 0
for k in range(len(S)):
  if S[k] == 'B':
    num += 1
  else:
    cnt += num
print(cnt)
from collections import deque

n,m = map(int, input().split())
dic = {}

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

dic = [[] for _ in range(n + 1)]

for a,b in AB:
    a -= 1
    b -= 1

    dic[a].append(b)
    dic[b].append(a)

#dist = {}
queue = deque([0])
visited = []
pre = {}

dist[0] = 0 
#queue.append(0)

while queue:
    v = queue.popleft()
    
    for i in dic[v]:
        if i in visited:
            continue
        
        visited.append(i)
        #dist[i] = dist[v] + 1
        pre[i]= v
        queue.append(i)

print("Yes")
for i in range(n):
    ans = 0
    
    if(i == 0):
        continue
    
    ans = pre[i]
    ans += 1
    print(ans)

### FIXED CODE ###

from collections import deque

n,m = map(int, input().split())
dic = {}

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

dic = [[] for _ in range(n + 1)]

for a,b in AB:
    a -= 1
    b -= 1

    dic[a].append(b)
    dic[b].append(a)

#dist = {}
queue = deque([0])
visited = []
pre = [-1] * (n+1)

#dist[0] = 0 
queue.append(0)

while queue:
    v = queue.popleft()
    
    for i in dic[v]:
        if pre[i] == -1:
        #dist[i] = dist[v] + 1
            pre[i]= v
            queue.append(i)

print("Yes")
for i in range(n):
    ans = 0
    
    if(i == 0):
        continue
    
    ans = pre[i]
    ans += 1
    print(ans)
while True:
    H, W = map(int, input().split())
    for i in range(H):
        for j in range(W):
            if (i + j) % 2:
                print('.', end='')
            else:
                print('#', end='')
        print()
    print()

### FIXED CODE ###

while True:
    H, W = map(int, input().split())
    if not(H or W):
        break
    for i in range(H):
        if i % 2:
            print('.#' * (W // 2) + '.' * (W % 2))
        else:
            print('#.' * (W // 2) + '#' * (W % 2))
    print()
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = [_ for _ in input()]

left_w = 0
right_e = S[1:].count('E')
min_sum = left_w + right_e

for i in range(N-1):
    if S[i] == 'W':
        left_w -= 1
    if S[i+1] == 'E':
        right_e += 1
    if min_sum < left_w + right_e:
        min_sum = left_w + right_e
        ans = i
print(ans)


### FIXED CODE ###

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

N = INT()
S = [_ for _ in input()]

left, right = 0, S[1:].count('E')
ans = left + right
for i in range(N-1):
    if S[i] == 'W':
        left += 1
    if S[i+1] == 'E':
        right -= 1

    ans = min(ans, left + right)

print(ans)
import numpy
N = input()
An = input().split()
AnS = numpy.prod(An)
print(AnS)


### FIXED CODE ###

import sys
N = int(input())
An = list(map(int,input().split()))
a = 1
if 0 in An:
    print("0")
    sys.exit()
else:
    for i in range(N):
        a *= An[i]
        if a > 10**18:
            print("-1")
            sys.exit()
    if a <= 10**18:
        print(a)
        sys.exit()
N = int(input())
K = list(map(int,input().split()))
A = [0]*N
for i in range(N):
    A[K[i]] += 1
r = 0
for k in range(N):
    r += 0.5*(A[k]*(A[k]-1))
An =[]
for j in range(N):
    D = A[K[j]]-1
    An.append(int(r-(0.5*(D+1)*(D))+(0.5*D*(D-1))))
for i in range(len(An)):
    print(An[i])

### FIXED CODE ###

N = int(input())
K = list(map(int,input().split()))
A = [0]*N
for i in range(N):
    A[K[i]-1] += 1
r = 0
for k in range(N):
    r += 0.5*(A[k]*(A[k]-1))
An =[]
for j in range(N):
    D = A[K[j]-1]-1
    An.append(int(r-(0.5*(D+1)*(D))+(0.5*D*(D-1))))
for i in range(len(An)):
    print(An[i])
a,b=map(in,input().split())
if a>b:
	print(a*2-1)
elif a<b:
	print(b*2-1)
else:
	print(a+b)

### FIXED CODE ###

a,b=map(int,input().split())
if a>b:
	print(a*2-1)
elif a<b:
	print(b*2-1)
else:
		print(a+b)
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

BIG_NUM = 200000000000
MOD = 1000000007
EPS = 0.000000001

def warshall_floyd(d,n):
    #d[i][j]:iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d

N,M,L = map(int,input().split())
d = [[BIG_NUM for i in range(N)] for j in range(N)]
for i in range(M):
    a,b,c = map(int,input().split())
    d[a-1][b-1] = c
    d[b-1][a-1] = c
for i in range(N):
    d[i][i] = 0

d = warshall_floyd(d,N)
for i in range(N):
    for j in range(i,N):
        if d[i][j] < L:
            d[i][j] = 1
            d[j][i] = 1
        else:
            d[i][j] = 0
            d[j][i] = 0
    d[i][i] = 1

d = warshall_floyd(d,N)
Q = int(input())
for q in range(Q):
    s,t = map(int,input().split())
    if d[s][t] <= BIG_NUM:
        print(-1)
    else:
        print(int(d[s][t]-1))
        


### FIXED CODE ###

from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall

BIG_NUM = 200000000000
MOD = 1000000007
EPS = 0.000000001

def warshall_floyd(d,n):
    #d[i][j]:iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d

N,M,L = map(int,input().split())
d = [[float("inf") for i in range(N)] for j in range(N)]
for i in range(M):
    a,b,c = map(int,input().split())
    d[a-1][b-1] = c
    d[b-1][a-1] = c
for i in range(N):
    d[i][i] = 0
d = floyd_warshall(d)
for i in range(N):
    for j in range(i,N):
        if d[i][j] <= L:
            d[i][j] = 1
            d[j][i] = 1
        else:
            d[i][j] = float("inf")
            d[j][i] = float("inf")
    d[i][i] = 1
d = floyd_warshall(d)
Q = int(input())
for q in range(Q):
    s,t = map(int,input().split())
    if d[s-1][t-1] == float("inf"):
        print(-1)
    else:
        print(int(d[s-1][t-1])-1)
h = input()
print(2h*3.14)

### FIXED CODE ###

R = int(input())
h = 2*R*3.14

print(h)
Ns=input()
N=int(N)
fX=0
for s in Ns:
  fX+=int(s)
if N%fX==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

Ns=input()
N=int(Ns)
fX=0
for s in Ns:
  fX+=int(s)
if N%fX==0:
  print('Yes')
else:
  print('No')
n = int(input())
judge = {"AC":0, "WA":0, "TLE":0, "RE":0}
for i in range(n):
  judge[i] += 1

for j in judge:
  print(f"{j} x {judge[j]}")
  

### FIXED CODE ###

n = int(input())
judge = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for _ in range(n):
    i = input()
    judge[i] += 1

for j in judge:
    print(f"{j} x {judge[j]} ")
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

ans = 'NO'
t = (B-A)/(V-W)

if 0 < t <= T:
  ans = 'YES'

print(ans)

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

ans = 'NO'
distance = abs(B-A)
if V == W:
  pass
else:
  t = distance/(V-W)
  if 0 < t <= T:
    ans = 'YES'

print(ans)
import sys
n = int(input())
x = int(input(),2)
if bin(x).count('1')+1 >= 1000:
    sys.setrecursionlimit(bin(x).count('1')+1)

ans = [0]*(bin(x).count('1')+1)
for i in range(1,len(ans)):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
for i in range(n):
    y = x^(1<<(n-i-1))
    t = y % bin(y).count('1')
    l.append(str(1+ans[t]))
    #print(1+ans[t])
print('\n'.join(l))

### FIXED CODE ###

n = int(input())
X = input()
x = int(X,2)
bitx = bin(x).count('1')
 
ans = [0]*(bitx+2)
for i in range(1,bitx+2):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
bitp = bitx + 1
bitm = bitx - 1
xmp = 0
xmm = 0


if bitx != 1:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
            xmm += pow(2, n-(i+1), bitm)
    for i in range(n):
        if X[i] == '1':
            xm = (xmm - pow(2,n-i-1,bitm)) % bitm
            l.append(str(1+ans[xm]))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
else:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
    for i in range(n):
        if X[i] == '1':
            l.append(str(0))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
print('\n'.join(l))
#coding:utf-8
from scipy.special import comb

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

ans = comb(N,2,exact = True) + comb(M,2,exact = True)

print(ans)


### FIXED CODE ###

#coding:utf-8
import itertools

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

ansN = len(list(itertools.combinations(range(N), 2)))
ansM = len(list(itertools.combinations(range(M), 2)))

ans = ansN + ansM
print(ans)
from collections import deque

def operation(command, arrey):
    if command[0] == 'insert':
        arrey.insert(0,command[1])
        return arrey
    elif command[0] == 'delete':
        if command[1] in arrey:
            arrey.remove(command[1])
    elif command[0] == 'deleteFirst':
        arrey.pop(0)
    elif command[0] == 'deleteLast':
        arrey.pop(-1)


n = int(input())
list = deque()

for i in range(n):
    command = input().split()
    operation(command,list)

for i in range(len(list)):
    print(list[i]) if i == len(list)-1 else print(list[i]+' ',end='')

### FIXED CODE ###

from collections import deque
import sys
 
n = int(sys.stdin.readline())
q = deque()
 
for i in range(n):
    command = sys.stdin.readline()[:-1]
    if command[0] == 'i':
        q.appendleft(command[7:])
    elif command[6] == ' ':
        try:
            q.remove(command[7:])
        except Exception as e:
            pass
    elif command[6] == 'F':
        q.popleft()
    else:
        q.pop()
 
print(' '.join(q))
# -*- coding: utf-8 -*-

#109_c
import numpy as np
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]

x.append(X)
sort_x = np.array(sorted(x))
kaisa = np.diff(sort_x, n=1).tolist()

print(gcd_list(kaisa))


### FIXED CODE ###

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

#109_c
import numpy as np
import math
from functools import reduce
from fractions import gcd

#最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]

x.append(X)
sort_x = np.array(sorted(x))

kaisa = np.diff(sort_x, n=1).tolist()

print(gcd_list(kaisa))
N = int(input())
edge = [[] for _ in range(N+1)]
for i in range(N-1):
  u,v,w = map(int, input().split())
  edge[u].append([v,w%2])
  edge[v].append([u,w%2])
color = [0]*(N+1)
visited = [False]*(N+1)
def dfs(u):
  for v,w in edge[u]:
    if visited[v]==False:
      #print(v)
      visited[v]=True
      color[v]=color[u]^w
      dfs(v)
  return 0
visited[1]=True
dfs(1)
ans = color[1:]
print(*ans,sep='\n')

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)

N = int(input())
edge = [[] for _ in range(N+1)]
for i in range(N-1):
  u,v,w = map(int, input().split())
  edge[u].append([v,w%2])
  edge[v].append([u,w%2])
color = [0]*(N+1)
visited = [False]*(N+1)
def dfs(u):
  for v,w in edge[u]:
    if visited[v]==False:
      #print(v)
      visited[v]=True
      color[v]=color[u]^w
      dfs(v)
  return 0
visited[1]=True
dfs(1)
ans = color[1:]
print(*ans,sep='\n')
w,h,n=map(int,input().split())
xya=[list(map(int,input().split())) for i in range(n)]
xya1=[i[0] for i in xya if i[2]==1]
xya2=[i[0] for i in xya if i[2]==2]
xya3=[i[1] for i in xya if i[2]==3]
xya4=[i[1] for i in xya if i[2]==4]
left=max(xya1)
right=min(xya2)
lower=max(xyz3)
upper=min(xyz4)
if left>=right or lower>=upper:
  print(0)
else:
  print((right-left)*(upper-lower))

### FIXED CODE ###

w,h,n=map(int,input().split())
xya=[list(map(int,input().split())) for i in range(n)]
xya1=[i[0] for i in xya if i[2]==1]+[0]
xya2=[i[0] for i in xya if i[2]==2]+[w]
xya3=[i[1] for i in xya if i[2]==3]+[0]
xya4=[i[1] for i in xya if i[2]==4]+[h]
left=max(xya1)
right=min(xya2)
lower=max(xya3)
upper=min(xya4)
if left>=right or lower>=upper:
  print(0)
else:
  print((right-left)*(upper-lower))
INF = float('inf')

H, N = map(int, input().split())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)


# i個目までを使って与えた魔力の総和がj以下の時の最小コスト
dp = [[INF for j in range(H + 1)] for i in range(N + 1)]

dp[0][0] = 0

for i in range(N):
    for j in range(H + 1):
        dp[i + 1][j] = min(dp[i][j], dp[i + 1][j - A[i]] + B[i])

print(dp[N][H])


### FIXED CODE ###

INF = float('inf')

H, N = map(int, input().split())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)


# i個目までを使って与えた魔力の総和がjの時の最小コスト
dp = [[INF for j in range(H + 1)] for i in range(N + 1)]

dp[0][0] = 0

for i in range(N):
    for j in range(H + 1):
        if j < A[i]:
            dp[i + 1][j] = min(dp[i][j], dp[i + 1][0] + B[i])
        else:
            dp[i + 1][j] = min(dp[i][j], dp[i + 1][j - A[i]] + B[i])

print(dp[N][H])
N = int(input())
T_list = [int(i) for i in input().split()]
M = int(input())
M_list = [[int(i) for i in input().split()] for i in range(M)]

base_value = sum(T_list)

for i in range(M):
    print(base_value - (T_list[M_list[i][0]-1] - M_list[i][1]))

### FIXED CODE ###

N = int(input())
T_list = [int(i) for i in input().split()]
M = int(input())
M_list = [[int(i) for i in input().split()] for i in range(M)]

base_value = sum(T_list)

for i in range(M):
    print(base_value - (T_list[M_list[i][0]-1] - M_list[i][1]))
N , M = (int(a) for a in input().split())
A = list(map(int,input().split()))
BC = [[int(a) for a in input().split()] for l in range(M)]
A =sorted(A)
BC = sorted(BC , key = lambda x: - x[1])
x = 0

for i in range(N*M) :
    if A[i] < BC[x][1] :
        A[i] = BC[x][1]
    else : break
    BC[x][0] -= 1
    if BC [-1][0] == 0:
        break
    if BC[x][0] == 0 :
        x += 1

print(sum(A))





### FIXED CODE ###

N , M = (int(a) for a in input().split())
A = list(map(int,input().split()))
BC = [[int(a) for a in input().split()] for l in range(M)]
A =sorted(A)
BC = sorted(BC , key = lambda x: - x[1])
s = 0

for i in range(N*M) :
    if A[i] < BC[s][1] :
        A[i] = BC[s][1]
    else : break
    BC[s][0] -= 1
    if BC [-1][0] == 0 or i == N-1 :
        break
    if BC[s][0] == 0 :
        s += 1

print(sum(A))
N, Q = map(int, input().split())
a=input()

list=[0]*N

for i in range(N):
    list[i+1]=list[i]+1 if a[i:i+2]=="AC" else list[i]
    
for i in range(N):
    l,r = map(int, input().split())
    print(list[r-1]-list[l-1])
    

### FIXED CODE ###

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

list=[0]*(N+1)

for i in range(N):
    list[i+1]=list[i]+1 if a[i:i+2]=="AC" else list[i]
    
for i in range(Q):
    l,r = map(int, input().split())
    print(list[r-1]-list[l-1])
n = int(input())
a = list(map(int, input().split()))

money = 1000
for i in range(n-1):
    if a[i] < a[i+1]:
        money += (a[i+1]-a[i])*(money//a[i])
print(money)

### FIXED CODE ###

a = int(input())

if 600 > a >= 400:
    print(8)
elif 800 > a >= 600:
    print(7)
elif 1000 > a >= 800:
    print(6)
elif 1200 > a >= 1000:
    print(5)
elif 1400 > a >= 1200:
    print(4)
elif 1600 > a >= 1400:
    print(3)
elif 1800 > a >= 1600:
    print(2)
elif 2000 > a >= 1800:
    print(1)
import math
a=int(input())
print(math.factorial(n)%(10**9+7))

### FIXED CODE ###

import math
n=int(input())
print(math.factorial(n)%1000000007)
n=int(input())
lista=list(map(int,input().split()))

goukei=0
count=0

for i in range(n):
    number=lista[i]+goukei
    if i%2==0:
        if number>=0:
            count=count+number+1
            goukei=-1
        else:
            goukei=number
    else:
        if number<=0:
            count=count+abs(number)+1
            goukei=1
        else:
            goukei=number

count1=count

goukei=0
count=0

for i in range(n):
    number=lista[i]+goukei
    if i%2==1:
        if number>=0:
            count=count+number+1
            goukei=-1
        else:
            goukei=number
    else:
        if number<=0:
            count=count+abs(number)+1
            goukei=1
        else:
            goukei=number
print(min(count,count1))

### FIXED CODE ###

a,b,c=input().split()
ans=a[0]+b[0]+c[0]
print(ans.upper())
n,k=map(int,input().split())

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

fumi = set([0])
start = None
end = None
aab = [0]
for i in range(2*10**5):
    next = aa[aab[-1]] - 1
    if next in fumi:
        if start is None:
            start = i
            fumi = set()
        else:
            end = i
            break
    aab.append(next)
    fumi.add(next)

random_first = len(aab) - 2*(end - start)
#print(aab, start, end, aab[start+1:end+1], aab[:random_first])

first = aab[:random_first]
one_cicle = aab[start+1:end+1]
if k <= len(first):
    print(first[k]+1)
else:
    k = k-len(first)
    print(one_cicle[k%len(one_cicle)]+1)

### FIXED CODE ###

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

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

fumi = set([0])
start = None
end = None
aab = [0]
for i in range(10**18):
    next = aa[aab[-1]] - 1
    if next in fumi:
        if start is None:
            start = i
            fumi = set()
        else:
            end = i
            break

    aab.append(next)
    fumi.add(next)
    if i+1 == k:
        print(next+1)
        exit(0)

random_first = len(aab) - 2*(end - start)
#print(aab, start, end, aab[start+1:end+1], aab[:random_first])

first = aab[:random_first]
one_cicle = aab[start+1:end+1]
if k <= len(first):
    print(first[k]+1)
else:
    k = k-len(first)
    print(one_cicle[k%len(one_cicle)]+1)
n = int(input())
robots = []
for i in range(n):
    x_tmp, l_tmp = (int(i) for i in input().split())
    robots.append({'x': x_tmp, 'l': l_tmp})

robots_sorted = sorted(robots, key=lambda x: x['x'])
ans = n
i = 0
while((robots_sorted[0]['x'] + robots_sorted[0]['l']) > (robots_sorted[1]['x'] - robots_sorted[1]['l'])):
    if(robots_sorted[0]['l'] > robots_sorted[1]['l'] * 2):
        robots_sorted.pop(0)
    else:
        robots_sorted.pop(1)

while(i < n-1):
    if((robots_sorted[i]['x'] + robots_sorted[i]['l']) > (robots_sorted[i+1]['x'] - robots_sorted[i+1]['l'])):
        if(i == n-2):
            if(robots_sorted[n-2]['l'] * 2 >= robots_sorted[n-1]['l']):
                robots_sorted.pop(i)
            else:
                robots_sorted.pop(i+1)
        elif(robots_sorted[i]['l'] > robots_sorted[i+1]['l']):
            robots_sorted.pop(i)
        else:
            robots_sorted.pop(i+1)
        i += -1
        n += -1
    i += 1

print(n)


### FIXED CODE ###

n = int(input())
robots = []
for i in range(n):
    x_tmp, l_tmp = (int(i) for i in input().split())
    robots.append([x_tmp - l_tmp, x_tmp + l_tmp])

robots.sort()
ans = n
right = robots[0][1]
for i in range(n-1):
    if(robots[i+1][0] < right):
        ans -= 1
        right = min(right, robots[i+1][1])
    else:
        right = robots[i+1][1]
print(ans)