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

n,x,y = map(int,input().split())
ans = [0 for _ in range(n-1)]
for i in range(n-1):
    for j in range(i+1,n):
        dis = min(j-i, abs(j-(x-1))+1+abs((y-1)-i), abs(j-(y-1))+1+abs((x-1)-i))
        ans[dis-1] += 1
for i in range(n-1):
    print(ans[i])

### FIXED CODE ###

n,x,y = map(int,input().split())
ans = [0]*(n-1)
for i in range(1,n):
    for j in range(i+1,n+1):
        dis = min(j-i, abs(j-x)+1+abs(y-i), abs(j-y)+1+abs(x-i))
        ans[dis-1] += 1
for i in range(n-1):
    print(ans[i])
### BUGGY CODE ###

from heapq import*
(N, M), *t = [map(int, s.split()) for s in open(0)]
q, z = [], 0
v = [q for _ in [None] * 10**5]
for a, b in t:
    v[a - 1] += b,
for i in v[:M]:
    for j in i:
        heappush(q, -j)
    if q:
        z += -heappop(q)
print(z)

### FIXED CODE ###

from heapq import*
(N, M), *t = [map(int, s.split()) for s in open(0)]
q = [0] * 10**5
v = [[] for _ in q]
for a, b in t:
    v[a - 1] += b,
z = 0
for i in v[:M]:
    for j in i:
        heappush(q, -j)
    z += -heappop(q)
print(z)
### BUGGY CODE ###

s = input()
q = int(input())

for i in range(q):
    query = input()
    if query[0] == '1':
        s = list(s)
        s.reverse()
        s = ''.join(s)
    else:
        if query[2] == '1':
            s = query[4]+s
        else:
            s = s+query[4]
print(s)

### FIXED CODE ###

s = input()
q = int(input())

t = 0
l = ''
r = ''
for i in range(q):
    query = input()
    if query == '1':
        if t == 1:
            t = 0
        else:
            t = 1
    else:
        if query[2] == '1':
            if t == 0:
                l = query[4:]+l
            else:
                r = r+query[4]
        else:
            if t == 0:
                r = r+query[4]
            else:
                l = query[4] + l
s = l+s+r
if t == 1:
    print(s[::-1])
else:
    print(s)
### BUGGY CODE ###

#input = raw_input

s = input()
q = int(input())

rev = False
for i in range(q):
    elms = input().split(" ")
    t = int(elms[0])
    if t == 1:
        rev = not rev
    else:
        f = int(elms[1])
        c = elms[2]

        if f == 1:
            if rev:
                s = s + c
            else:
                s = c + s
        else:
            if rev:
                s = c +s
            else:
                s = s + c
if rev:
    s = s[::-1]
print(s)

### FIXED CODE ###

#input = raw_input

s = input()
q = int(input())

inputs = []
n_reverse = 0
for i in range(q):
    input_ = input()
    if input_[0] == "1":
        n_reverse += 1
    inputs.append(input_)

if n_reverse % 2 == 0:
    final_rev = False
else:
    final_rev = True

rev = False
mae = ""
ushiro = ""
for input_ in inputs:
    elms = input_.split(" ")
    t = int(elms[0])
    if elms[0] == "1":
        rev = not rev
    else:
        f = int(elms[1])
        c = elms[2]

        if f == 1:
            if final_rev:
                if rev:
                    mae = c + mae
                else:
                    ushiro = ushiro + c
            else:
                if rev:
                    ushiro = ushiro + c
                else:
                    mae = c + mae
        else:
            if final_rev:
                if rev:
                    ushiro = ushiro + c
                else:
                    mae = c + mae
            else:
                if rev:
                    mae = c + mae
                else:
                    ushiro = ushiro + c

if final_rev:
    s = s[::-1]

out = mae + s + ushiro
print(out)
### BUGGY CODE ###

N = int(input())

arr = [i+1 for i in range(N)]
if N == 1:
    print(0)
else:
    print((1+(N-1))*(N-1)//2)

### FIXED CODE ###

N = int(input())

if N == 1:
    print(0)
else:
    print((1+(N-1))*(N-1)//2)
### BUGGY CODE ###

r,g,b,n = map(int,input().split())
ans = 0

for i in range(n + 1):
  for j in range(n + 1):
    tmp = n - i*r - j*g
    if tmp >= 0 and tmp%b == 0:
      ans += 1

print(ans)


### FIXED CODE ###

r,g,b,n = map(int,input().split())
ans = 0

for i in range(n + 1):
  for j in range(n + 1):
    tmp = n - i*r - j*g
    if tmp >= 0 and tmp%b == 0:
      ans += 1

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

N, Q = list(map(int, input().split()))
STX = [list(map(int, input().split())) for _ in range(N)]
D = [int(input()) for _ in range(Q)]

STX.sort(key = lambda x: x[2])

L = [[-1, -1]] * Q
for s, t, x in STX:
  n = s - x
  ok = Q
  ng = -1
  while abs(ok - ng) > 1:
    mid = abs(ok + ng) // 2
    if D[mid] >= n:
      ok = mid
    else:
      ng = mid
  l = ok

  n = t - x
  ok = Q
  ng = l - 1
  while abs(ok - ng) > 1:
    mid = abs(ok + ng) // 2
    if D[mid] >= n:
      ok = mid
    else:
      ng = mid
  r = ok

  while l < r:
    if L[l][1] == -1:
      L[l] = [x, r]
      l += 1
    else:
      l = L[l][1]

for i in L:
  print(i[0])

### FIXED CODE ###

import heapq
def main():
  N, Q = list(map(int, input().split()))
  STX = tuple(list(map(int, input().split())) for _ in range(N))
  D = tuple([int(input()) for _ in range(Q)])

  L = []
  for s, t, x in STX:
    L.append((x, s - x, t - x))

  L.sort(key = lambda x: x[1])
  q = []
  cnt = 0
  push = heapq.heappush
  pop = heapq.heappop
  t = []
  for i in range(Q):
    while cnt < len(L) and D[i] >= L[cnt][1]:
      if t != []:
        push(q, t)
        t = []
      push(q, L[cnt])
      cnt += 1
    if t != [] and t[2] > D[i]:
      print(t[0])
    else:
      while q != []:
        t = pop(q)
        if t[2] > D[i]:
          print(t[0])
          break
      else:
        t = []
        print(-1)

main()
### BUGGY CODE ###

h,w=map(int,input().split())
grid=[list(input()) for _ in range(h)]
q=[]
for i in range(h):
  for j in range(w):
    if grid[i][j]=='#':
      q.append((i,j,0))
dx=[-1,0,1,0]
dy=[0,1,0,-1]
ans=0
while q:
  ny,nx,cnt=q.pop(0)
  for i in range(4):
    cy=ny+dy[i]
    cx=nx+dx[i]
    if 0<=cy<h and 0<=cx<w and grid[cy][cx]=='.':
      grid[cy][cx]='#'
      q.append((cy,cx,cnt+1))
      ans=max(ans,cnt+1)
print(ans)

### FIXED CODE ###

import numpy as np
h,w=map(int,input().split())
a=[]
for i in range(h):
  a.append([0 if i=='#' else h+w for i in list(input())])
a=np.array(a)
for i in range(h-1):
  a[i+1,:]=np.minimum(a[i,:]+1,a[i+1,:])
for i in range(h-1,0,-1):
  a[i-1,:]=np.minimum(a[i,:]+1,a[i-1,:])
for i in range(w-1):
  a[:,i+1]=np.minimum(a[:,i]+1,a[:,i+1])
for i in range(w-1,0,-1):
  a[:,i-1]=np.minimum(a[:,i]+1,a[:,i-1])
print(np.max(a))
### BUGGY CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter


def main():
    N = int(input())
    S = [input() for _ in range(N)]
    S = Counter(S)

    result = []
    for key, value in S.items():
        if value == S.most_common()[0][1]:
            result.append(key)
    result.sort()
    for r in result:
        print(r)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter


def main():
    N = int(input())
    S = [input() for _ in range(N)]
    S = Counter(S)

    SM = S.most_common()[0][1]
    S = sorted(S.items(), key=lambda x: [-x[1], x[0]])
    for key, value in S:
        if value == SM:
            print(key)
        else:
            break


if __name__ == "__main__":
    main()
### BUGGY CODE ###

n,m = map(int,input().split())
a_L = list(map(int,input().split()))

#a_L = list(sorted(a_L))
#max_num = a_L[0]
#a_L.append(max_num)

for val in range(0,m):
    a_L = list(sorted(a_L))
    a_L[-1] = a_L[-1] //2

print(sum(a_L))



### FIXED CODE ###

import heapq

n,m = map(int,input().split())
a_L = list(map(lambda x:int(x) * -1,input().split()))

heapq.heapify(a_L)
#a_L = list(sorted(a_L))
#max_num = a_L[0]
#a_L.append(max_num)

for val in range(0,m):
    a_min = heapq.heappop(a_L)
    a_min = (-1 * a_min)//2 * -1
    heapq.heappush(a_L,a_min)

print(-sum(a_L))
### BUGGY CODE ###

import sys
from collections import deque
H, W, M = map(int, input().split())
S = list(tuple(map(int, input().split())) for _ in range(M))
hh = dict()
ww = dict()
for i in range(M):
    h, w = S[i]
    if h in hh.keys():
        hh[h] += 1
    else:
        hh[h] = 1
    if w in ww.keys():
        ww[w] += 1
    else:
        ww[w] = 1
hhh = sorted(hh.items(), key=lambda x:x[1], reverse=True)
www = sorted(ww.items(), key=lambda x:x[1], reverse=True)
ans = hhh[0][1] + www[0][1]
if (hhh[0][0], www[0][0]) not in S:
    print(ans)
    sys.exit()
h = hhh[0][0]
for j in range(1, len(www)):
        if www[j][1] == www[j-1][1]:
            if (h, www[j][0]) not in S:
                print(ans)
                sys.exit()
        else:
            break
for i in range(1, len(hhh)):
    if hhh[i][1] == hhh[i-1][1]:
        h = hhh[i][0]
        if (h, www[0][0]) not in S:
            print(ans)
            sys.exit()
        for j in range(1, len(www)):
            if www[j][1] == www[j-1][1]:
                if (h, www[j][0]) not in S:
                    print(ans)
                    sys.exit()
            else:
                break
    else:
        break
print(ans-1)
        


### FIXED CODE ###

import sys
from collections import deque
H, W, M = map(int, input().split())
S = list(tuple(map(int, input().split())) for _ in range(M))
hh = dict()
ww = dict()
for i in range(M):
    h, w = S[i]
    if h in hh.keys():
        hh[h] += 1
    else:
        hh[h] = 1
    if w in ww.keys():
        ww[w] += 1
    else:
        ww[w] = 1
hhh = sorted(hh.items(), key=lambda x:x[1], reverse=True)
www = sorted(ww.items(), key=lambda x:x[1], reverse=True)
h = hhh[0][1]
w = www[0][1]
ans = h+w
Nh = 0
Nw = 0
for i in range(len(hhh)):
    if h == hhh[i][1]:
        Nh += 1
    else:
        break
for i in range(len(www)):
    if w == www[i][1]:
        Nw += 1
    else:
        break
tt = Nh*Nw
if tt > M:
    print(ans)
    sys.exit()

for tmp in S:
    if hh[tmp[0]] == h and ww[tmp[1]] == w:
        tt -= 1
if tt > 0:
    print(ans)
else:
    print(ans-1)
### BUGGY CODE ###

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

if n == 1:
    print(m)
    exit()
a = []
for i in range(1, m):
    if m % n == 0:
        print(m // n)
        exit()
    if i * n <= m and m % i == 0:
        a.append(i)

print(max(a))


### FIXED CODE ###

import math
n, m = map(int, input().split())

if n == 1:
    print(m)
    exit()
a = []
b = []
for i in range(1, math.ceil(math.sqrt(m))):
    if m % n == 0:
        print(m // n)
        exit()
    if m % i == 0:
        b.append(i)
        b.append(m // i)
        
#print(b)

for i in range(len(b)):
    if b[i] * n <= m:
        a.append(b[i])
#print(a)

if len(b) == 2:
    print(1)
else:
    print(max(a))
### BUGGY CODE ###

n=int(input())
s=input()
l=set()
for i in range(0,n-2):
    if i>=1 and s[i]==s[0]  :
        continue
    for j in range(i+1,n-1):
        # print(i,s[i])
        if i==0 and j>=2 and s[j]==s[1]  :
            continue
        for k in range(j+1,n):
            if i==0 and j==1 and k>=3 and s[k]==s[2]:
                continue
            m=s[i]+s[j]+s[k]
            l.add(m)



print(len(l))


### FIXED CODE ###

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

for i in range(0,n-2):
    a=set()
    if s[i] in r:
        continue
    else:
        r.add(s[i])
    for j in range(i+1,n-1):
        if s[j] in a:
            continue
        else:
            a.add(s[j])
        for k in range(j+1,n):
            if j==1 and k>=3 and s[k]==s[2]:
                continue
            m=s[i]+s[j]+s[k]
            l.add(m)
print(len(l))
### BUGGY CODE ###

from bisect import bisect

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

a2=[]

for i in range(n):
    temp = a[i]-(i+1)
    index = bisect(a2,temp)
    a2.insert(index,temp)

ans = sum( abs(x - a2[n//2]) for x in a2)
print(ans)

### FIXED CODE ###

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

a2 = [ x-i for i,x in enumerate(a)]
a2.sort()

ans = sum( abs(x - a2[n//2]) for x in a2)
print(ans)
### BUGGY CODE ###

N,K = map(int,input().split())
l = []
for i in range(K):
    L,R = map(int,input().split())
    l.append([L,R])


a = [0 for i in range(N+1)]
a[1] = 1
b = [0 for i in range(N+1)]
b[1] = 1
for i in range(2,N+1):
    for j in range(K):
        if l[j][0] < i:
            a[i] += b[i-l[j][0]]-b[max(0,i-l[j][1]-1)]
    b[i] = b[i-1]+a[i]
mod = 998244353
print(a[N]%mod)

### FIXED CODE ###

N,K = map(int,input().split())
l = []
mod = 998244353
for i in range(K):
    L,R = map(int,input().split())
    l.append([L,R])
l.sort()

a = [0 for i in range(N+1)]
a[1] = 1
b = [0 for i in range(N+1)]
b[1] = 1
for i in range(2,N+1):
    for j in range(K):
        if l[j][0] < i:
            a[i] += (b[i-l[j][0]]-b[max(0,i-l[j][1]-1)])%mod
        else:
            break
    b[i] = (b[i-1]+a[i])%mod
mod = 998244353
print(a[N]%mod)
### BUGGY CODE ###

import sys

def gcd(x, y, *val):
    val = [x, y] + list(val)
    val.sort(reverse=True)
    count = len(val)

    if count == 2:
        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        if count % 2 == 1:
            val.append(val[-1])

        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, count, 2)])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    if num == 2:
        print(max(input))
        return

    for i in range(num):
        mem = input.pop(num - 1 - i)
        gcd_max = max(gcd_max, gcd(*(input + input_mem)))
        input_mem.append(mem)

    print(gcd_max)



if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def gcd(x, y, *val):
    val = sorted([x, y], reverse=True) + list(val)
    count = len(val)

    if count == 2:
        if val[1] == 0:
            return val[0]

        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        if count % 2 == 1:
            val.append(val[-1])

        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, count, 2)])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    if num == 2:
        print(max(input))
        return

    gcd_left = [0]
    gcd_right = [0]

    for i in range(num - 1):
        gcd_left.append(gcd(input[i], gcd_left[i]))
        gcd_right.append(gcd(input[-1 - i], gcd_right[i]))

    gcd_right.reverse()
    gcd_list = []

    for i in range(num):
        gcd_list.append(gcd(gcd_left[i], gcd_right[i]))

    print(max(gcd_list))



if __name__ == "__main__":
    main()
### BUGGY CODE ###

N,M = map(int,input().split())
H_list = [int(i) for i in input().split()]
not_good_list = []
AB_list = []
for i in range(M) :
    AB_list.append([int(i) for i in input().split()])

# AB_list = list(set(list(map(tuple,AB_list))))

# for i in range(M) :
for t in AB_list :
    A = t[0]
    B = t[1]

    if (A not in not_good_list) :
        if (H_list[A-1] <= H_list[B-1]) :
            not_good_list.append(A)

    if (B not in not_good_list) :
        if (H_list[B-1] <= H_list[A-1]) :
            not_good_list.append(B)
            continue

# for t in AB_list :
#     A = t[1]
#     B = t[0]

#     if (A in not_good_list) :
#         continue

#     if (H_list[A-1] <= H_list[B-1]) :
#         not_good_list.append(A)
#         continue
print(N - len(not_good_list))

### FIXED CODE ###

N,M = map(int,input().split())
H_list = [int(i) for i in input().split()]
# not_good_list = []
not_good_set = set()
not_good_count = 0
AB_list = []
for i in range(M) :
    AB_list.append([int(i) for i in input().split()])

for t in AB_list :
    A = t[0]
    B = t[1]

    if (A not in not_good_set) :
        if (H_list[A-1] <= H_list[B-1]) :
            not_good_set.add(A)
            not_good_count += 1

    if (B not in not_good_set) :
        if (H_list[B-1] <= H_list[A-1]) :
            not_good_set.add(B)
            not_good_count += 1
            continue

print(N - not_good_count)
### BUGGY CODE ###

import math
def main():
    N,D,A = map(int, input().split())
    X,H = [0]*N,[0]*N
    tmp = [(0,0) for _ in range(N)]
    for i in range(N):
        tmp[i] = list(map(int, input().split()))
        tmp[i][0] -= 1
    # 座標順になるようにソートしておく
    tmp = sorted(tmp, key=lambda x:x[0])
    for i,l in enumerate(tmp): (X[i],H[i]) = l
    # 座標X[i]のモンスターはceil(H[i]/A)回攻撃すれば倒せる
    # N=5, D=2
    # 0 1 2 3 4 5 6 7 8 9 10
    # 0 5 0 2 0 0 3 3 0 0 4 (倒すのに必要な回数; 全部0にすれば終了)
    # 0 0 0 0 0 0 3 3 0 0 4 (座標3で5回爆破したあと)
    # 0 0 0 0 0 0 0 0 0 0 1 (座標8で3回爆破したあと)
    # 0 0 0 0 0 0 0 0 0 0 0 (座標10で1回爆破したあと)
    # ->よって5+3+1=9回が最小回数..?
    ans = 0
    for i in range(len(X)):
        if sum(H)<=0: break
        if H[i]>0:
            # X[i]+Dで爆破を行う
            bomb = math.ceil(H[i]/A)
            ans += bomb
            for j,p in enumerate(X[i:]):
                if p<X[i]+2*D+1:
                    H[i+j] = max(0,H[i+j]-A*bomb)
                else:
                    break
    print(ans)

main()


### FIXED CODE ###

from math import ceil
from collections import deque
def main():
    N,D,A = map(int, input().split())
    # 座標X[i]のモンスターはceil(H[i]/A)回攻撃すれば倒せる
    # N=5, D=2
    # 0 1 2 3 4 5 6 7 8 9 10
    # 0 5 0 2 0 0 3 3 0 0 4 (倒すのに必要な回数; 全部0にすれば終了)
    # 0 0 0 0 0 0 3 3 0 0 4 (座標3で5回爆破したあと)
    # 0 0 0 0 0 0 0 0 0 0 1 (座標8で3回爆破したあと)
    # 0 0 0 0 0 0 0 0 0 0 0 (座標10で1回爆破したあと)
    # ->よって5+3+1=9回が最小回数..?

    Monsters = sorted([list(map(int, input().split())) for i in range(N)])
    Monsters = [[x-1, ceil(h / A)] for x, h in Monsters]

    acc_damage = 0
    que = deque([])

    ans = 0
    for x, h in Monsters:
        # 期限切れの蓄積ダメージを削除
        while que and x > que[0][0]:
            limit, damage = que.popleft()
            acc_damage -= damage

        need = max(0, h - acc_damage)
        ans += need
        acc_damage += need

        if need:
            que.append([x + 2 * D, need])

    print(ans)


main()
### BUGGY CODE ###

from collections import deque

N, M= [int(i) for i in input().split(' ')]
graph = {}

for i in range(1,N+1):
  graph[i] = []

for j in range(M):
  a, b= [int(i) for i in input().split(' ')]
  graph[a].append(b)
  graph[b].append(a)
    

def bfs(graph, start):
  queue = [start]
  visited1 = []
  visited = {}
  for i in range(1,N+1):
    visited[i] = 0  
  miti = {}
  for i in range(1,N+1):
    miti[i] = 0
  while queue:
    label = queue.pop(0)
    for i in graph[label]:
      if visited[i] != 0:
        continue
      visited1.append(i)
      visited[i] = 1
      queue.append(i)
      if miti[i] != 0:
        return False
      miti[i] = label
    if len(visited1) == N:
      break
  if len(visited1) != N:
    return False
  return miti

miti = bfs(graph, 1)
if miti:
  print('Yes')
  for i in range(2,N+1):
    print(miti[i])
else:
  print('No')

### FIXED CODE ###

N, M= [int(i) for i in input().split(' ')]
graph = {}
 
for i in range(1,N+1):
  graph[i] = []
 
for j in range(M):
  a, b= [int(i) for i in input().split(' ')]
  graph[a].append(b)
  graph[b].append(a)
    
 
def bfs(graph, start):
  queue = [start]
  miti = [-1 for _ in range(N)]

  while queue:
    label = queue.pop(0)
    for i in graph[label]:
      if miti[i-1] < 0:
        queue.append(i)
        miti[i-1] = label
  return miti
 
miti = bfs(graph, 1)
if miti:
  print('Yes')
  for i in range(2,N+1):
    print(miti[i-1])
else:
  print('No')
### BUGGY CODE ###

n,m=map(int,input().split())
r=[[] for x in range(n)]
for c in range(m):
    a,b=map(int,input().split())
    r[a-1].append(b-1)
    r[b-1].append(a-1)
s=[-1]*n
u=[0]
v=[]
for c in range(10**5):
    for d in u:
        for e in r[d]:
            if s[e]==-1:
                s[e]=d
                v.append(e)
    u=v
print('Yes')
for c in range(n-1):
    print(s[c+1]+1)

### FIXED CODE ###

n,m=map(int,input().split())
g=[[] for x in range(n)]
for c in range(m):
    a,b= map(int,input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)

ans_list=[-1]*n

queue=[0]

while queue:
    qi=queue.pop(0)
    for gi in g[qi]:
        if ans_list[gi]==-1:
            queue.append(gi)
            ans_list[gi]=qi

print("Yes")
for ans in ans_list[1:]:
    print(ans+1)
### BUGGY CODE ###

#import heapq
#import itertools
#import math
#import numpy as np
#import sys

#N = int(input())
N, K, Q = list(map(int, input().split()))
A = [int(input()) for _ in range(Q)]

for i in range(1,N+1) :
    s = 0
    for a in A :
        if i == a :
            s += 1
    if s > Q - K :
        print('Yes')
    else :
        print('No')


#T = [list(map(int,input().split())) for _ in range(N)]
#H = [K] * N
#print(A)
#print(H)
#for a in A :
#    for i in range(N) :
#        if i == int(a) :
#            pass
#        else :
#            H[i -1] -= 1
#for h in H :
#    if h > 0 :
#        print('Yes')
#    else :
#        print('No')
#ans = ['Yes' if h > 0 else 'No' for h in H]
#for a
#print(ans)

### FIXED CODE ###

#import heapq
#import itertools
#import math
#import numpy as np
#import sys

#N = int(input())
N, K, Q = list(map(int, input().split()))
A = [int(input()) for _ in range(Q)]
S = [0] * N
for i in A :
    S[i - 1] += 1
for s in S :
    if s > Q - K :
        print('Yes')
    else :
        print('No')


#for i in range(1,N+1) :
#    s = 0
#    for a in A :
#        if i == a :
#            s += 1
#    if s > Q - K :
#        print('Yes')
#    else :
#        print('No')


#T = [list(map(int,input().split())) for _ in range(N)]
#H = [K] * N
#print(A)
#print(H)
#for a in A :
#    for i in range(N) :
#        if i == int(a) :
#            pass
#        else :
#            H[i -1] -= 1
#for h in H :
#    if h > 0 :
#        print('Yes')
#    else :
#        print('No')
#ans = ['Yes' if h > 0 else 'No' for h in H]
#for a
#print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
n = int(input())
x = eval('0b' + input())

def popcount(x):
    res = 0
    for i in range(x.bit_length()+1):
        if x & (1 << i):
            res += 1 
    return res

memo = {}

# def slove(x):
#     cnt = 0
#     tmp = []
#     while x:
#         if x in memo:
#             return cnt + memo[x]
#         else:

#         x = x % popcount(x)
#         cnt += 1
#     return cnt

def solve(x, cnt):
    if x == 0:
        return cnt

    if x in memo:
        return cnt + memo[x]
    else:
        ans = solve(x % popcount(x), cnt + 1)
        memo[x] = ans - cnt
        return ans


px = popcount(x)
ans = []

for i in range(n):
    y = 0
    if x & (1 << i):
        y = x & ~(1 << i)
    else:
        y= x | (1 << i)
    ans.append(solve(y, 0))

for ansi in reversed(ans):
    print(ansi)


    

        


### FIXED CODE ###

from collections import deque

n = int(input())
x = input()

memo = {0: 0}

def solve(X):
    x = X
    stack = deque([])
    while x:
        if x in memo:
            break
        stack.append(x)
        x = x % bin(x).count("1")
    cnt = memo[x] + 1
    while stack:
        x = stack.pop()
        memo[x] = cnt
        cnt += 1
    return cnt - 1



ans = []
px = x.count("1")

memo1 = [1 % (px - 1)] if px > 1 else []
memo2 = [1 % (px + 1)]
x1 = 0
x2 = 0

for i in range(n):
    if px > 1:
        memo1.append(memo1[-1] * 2 % (px-1))
    memo2.append(memo2[-1] * 2 % (px+1))

for i in range(n):
    if x[-i-1] == '1':
        if px > 1:
            x1 += memo1[i]
            x1 %= (px-1)
        x2 += memo2[i]
        x1 %= (px+1)

for i in range(n):
    if x[-i-1] == "1":
        if px > 1:
            ans.append(solve((x1-memo1[i])%(px-1)) + 1)
        else:
            ans.append(0)
    else:
        ans.append(solve((x2+memo2[i])%(px+1)) + 1)


for ansi in reversed(ans):
    print(ansi)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
result = 0
for i in range(n):
  for j in range(i + 1, n):
    result += ((a[i] % (10**9 + 7)) * (a[j] % (10**9 + 7))) % (10**9 + 7)
result = result % (10**9 + 7)
print(result)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
sum_a = 0
result = 0
for i in range(n):
  sum_a += a[i]
for j in range(n):
  sum_a -= a[j]
  result += sum_a * a[j]
print(result % (10**9 + 7))