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

import sys
Input = sys.stdin.readline

A, B, K = map(int, Input().split())
N = [n for n in range(A, B+1) if n < A+K or n > B-K]
for n in N:
    print(n)

### FIXED CODE ###

import sys
Input = sys.stdin.readline

A, B, K = map(int, Input().split())

if K < ((B-A) // 2) + 1:
    for i in range(K):
        print(A+i)
    for i in range(K):
        print(B-K+i+1)
else:
    for n in range(A, B+1):
        print(n)
### BUGGY CODE ###

N = int(input())
S =[str(input()) for i in range(N)]

G = []

for i in range(N):
    goods = S[i]
    if goods in G:
        continue
    else:
        G.append(goods)


print(len(G))

### FIXED CODE ###

N = int(input())
S =[str(input()) for i in range(N)]

print(len(set(S)))
### BUGGY CODE ###

num = input().split(" ")
ki = 0
gu = 0
sum_kaku = 0
for a in range(int(num[1])):
  if (a+1) % 2 == 0:
    gu += 1
  else:
    ki += 1
a = 0
while a < int(num[0]):
  if a % 2 == 0:
    sum_kaku += ki
  else:
    sum_kaku += gu
  a += 1
print(sum_kaku)
  

### FIXED CODE ###

num = input().split(" ")
if "1" in num:
  print(1)
else:
	gu = int(num[1]) // 2
	ki = int(num[1]) - int(gu)
	gu2 = int(num[0]) // 2
	ki2 = int(num[0]) - int(gu2)
	print(gu * gu2 + ki * ki2)
### BUGGY CODE ###

n = int(input())
output = []
for i in range(n):
    li = input().split(' ')
    if(li[0] == 'insert'):
        output.insert(0, int(li[1]))
    elif(li[0] == 'delete'):
        if(int(li[1]) in output):
            output.remove(int(li[1]))
    elif(li[0] == 'deleteFirst'):
        del output[0]
    elif(li[0] == 'deleteLast'):
        del output[-1]
str_l = [str(o) for o in output]
print(' '.join(str_l))



### FIXED CODE ###

from collections import deque
n = int(input())
output = deque()
for i in range(n):
    li = input().split(' ')
    if(li[0] == 'insert'):
        output.appendleft(li[1])
    elif(li[0] == 'deleteFirst'):
        output.popleft()
    elif(li[0] == 'deleteLast'):
        output.pop()
    elif(li[0] == 'delete'):
        try:
            output.remove(li[1])
        except:
            pass
print(' '.join(output))
### BUGGY CODE ###

n,m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(m):
	target = max(a)	
	a[a.index(target)] = target // 2
print(sum(a))	

### FIXED CODE ###

import heapq
n,m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

for i in range(m):
	target = heapq.heappop(a)
	heapq.heappush(a, (-1)*(-target//2))
	
print(-sum(a))
### BUGGY CODE ###

n,m=map(int,input().split())
d=[list((map(int,input().split()))) for _ in range(m)]
c=[list((map(int,input().split()))) for _ in range(n)]
x=[[[True for _ in range(n)] for _ in range(n)] for _ in range(m)]
for k in range(m):
    for i in range(n):
        for j in range(n):
            if c[i][j]==k+1:
                x[k][i][j]=False
res=[]
for c1 in range(m):
    for c2 in range(m):
        for c3 in range(m):
            if c1==c2 or c2==c3 or c1==c3:
                pass
            else:
                t=0
                for i in range(n):
                    for j in range(n):
                        if (i+j)%3==0:
                            if x[c1][i][j]:
                                t+=d[c[i][j]-1][c1]
                        if (i+j)%3==1:
                            if x[c2][i][j]:
                                t+=d[c[i][j]-1][c2]
                        if (i+j)%3==2:
                            if x[c3][i][j]:
                                t+=d[c[i][j]-1][c3]
                res.append(t)
print(min(res))

### FIXED CODE ###

n,m=map(int,input().split())
d=[list((map(int,input().split()))) for _ in range(m)]
c=[list((map(int,input().split()))) for _ in range(n)]
x=[[0 for _ in range(m)] for _ in range(3)]

for i in range(n):
    for j in range(n):
        x[(i+j)%3][c[i][j]-1]+=1
res=[]
for c1 in range(m):
    for c2 in range(m):
        for c3 in range(m):
            if c1==c2 or c2==c3 or c1==c3:
                pass
            else:
                ans=0
                for i in range(m):
                    ans+=x[0][i]*d[i][c1]
                for i in range(m):
                    ans+=x[1][i]*d[i][c2]
                for i in range(m):
                    ans+=x[2][i]*d[i][c3]
                res.append(ans)
print(min(res))
### BUGGY CODE ###

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

ml = [0 for _ in range(n)]

while len(set(dl)) != 1 :
    for i in range(n) :
        if dl[i] == max(dl) :
            if dl[i-1] >= dl[(i+1)%n] :
                lain = dl[i]-dl[i-2]
                dl[i-1] -= lain
                dl[i] -= lain
                ml[i] += 2*lain
            else :
                lain = dl[i]-dl[(i+2)%n]
                dl[i] -= lain
                dl[(i+1)%n] -= lain
                ml[(i+1)%n] += 2*lain
else :
    for i in range(n) :
        ml[i] += dl[-1]

for i in range(n) :
    print(ml[i],end=" ")

### FIXED CODE ###

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

# m0 + m1 + m2 + m3 + m4 = d0 + d1 + d2 + d3 + d5
# d0 = (m0 + m1)//2
# d1 = (m1 + m2)//2
# d2 = (m2 + m3)//2
# d3 = (m3 + m4)//2
# d4 = (m4 + m0)//2
# m0 =  d0 - d1 + d2 - d3 + d4
# m1 =  d0 + d1 - d2 + d3 - d4
# m2 = -d0 + d1 + d2 - d3 + d4
# m3 =  d0 - d1 + d2 + d3 - d4
# m4 = -d0 + d1 - d2 + d3 + d4   
s = sum(a)
p = [0 for _ in range(n)]
q = [0 for _ in range(n+1)]
for i in range(n) :
    if i>1 :
        p[i] = p[i-2] + a[i-2]
    q[n-i-2] = q[n-i] + a[n-i-1]

print(*[s-2*p[i]-2*q[i] for i in range(n)])
### BUGGY CODE ###

def main():
#    N, X, T = map(int, input().split())
    N = input()
    heights = [int(s) for s in input().split()]

    sum = 0
    while True:
        max_value = 0
        max_index = 0
        temp_sum =0
        for i in range(0, len(heights)):
            if max_value < heights[i]:
                max_value = heights[i]
                max_index = i
                temp_sum = 0
            temp_sum= temp_sum + heights[i]

        sum = sum + (len(heights) - max_index ) * max_value - temp_sum
        if max_index == 0 :
            break

        heights = heights[0:max_index]
    print(sum)
main()

### FIXED CODE ###

def main():
#    N, X, T = map(int, input().split())
    N = input()
    heights = [int(s) for s in input().split()]

    sum = 0

    max_value = 0

    for i in range(0, len(heights)):
        if max_value < heights[i]:
            max_value = heights[i]
        else:
            sum = sum + max_value - heights[i]


    print(sum)
main()
### BUGGY CODE ###

import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N,M =LI()
X,Y=[],[]
for i in range(M):
	a = LI()
	if a[0] == 1:
		X.append(a[1])
	if a[1] == N:
		Y.append(a[0])
	
for x in X:
	if x in Y:
		print("POSSIBLE")
		exit()
	

	
print("IMPOSSIBLE")

### FIXED CODE ###

import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N,M =LI()
X,Y=[],[]
for i in range(M):
	a = LI()
	if a[0] == 1:
		X.append(a[1])
	if a[1] == N:
		Y.append(a[0])
X=set(X)
Y=set(Y)
for x in X:
	if x in Y:
		print("POSSIBLE")
		exit()
	

	
print("IMPOSSIBLE")
### BUGGY CODE ###

k, s = map(int, input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
           if x+y+z==s:
               ans += 1
print(ans)

### FIXED CODE ###

k, s = map(int, input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if x+y+z==s and 0<=z<=k:
            ans += 1
print(ans)
### BUGGY CODE ###

x, y, z, k = map(int, input().split())
X = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]
Z = [int(i) for i in input().split()]
X.sort(reverse=1)
Y.sort(reverse=1)
Z.sort(reverse=1)

answer = []
for i in X[:k]:
    for j in Y[:k]:
        answer.append(i+j)
answer.sort(reverse=1)

answer2 = []
for l in Z[:k]:
    for a in answer[:k]:
        answer2.append(l+a)
answer2.sort(reverse=1)

for p in answer2[:k]:
    print(p)

### FIXED CODE ###

x, y, z, k = map(int, input().split())
X = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]
Z = [int(i) for i in input().split()]
X.sort(reverse=1)
Y.sort(reverse=1)
Z.sort(reverse=1)

answer = [i+j for i in X[:k] for j in Y[:k]]
answer.sort(reverse=1)

answer2 = [i+j for i in Z[:k] for j in answer[:k]]
answer2.sort(reverse=1)

for p in answer2[:k]:
    print(p)
### BUGGY CODE ###

import copy
from heapq import heappop, heapify, heappush
import math
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
F = [int(i) for i in input().split()]
ans = 0
A.sort(reverse=True)
F.sort()
s = []
for i in range(N):
    s.append((-A[i]*F[i], A[i], F[i]))
heapify(s)

def f(l, T):
    cur = 0
    S = copy.deepcopy(l)
    while cur <= K:
        if len(S) == 0:
            break
        a, b, c = heappop(S)
        a = -a
        if a <= T:
            break
        cur += math.ceil((a - T)/c)
    if cur <= K:
        return True
    else:
        return False

ok, ng = -s[0][0], -1
while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    if f(s, mid) == True:
        ok = mid
    else:
        ng = mid
print(ok)

### FIXED CODE ###

def main():
    import copy
    from heapq import heappop, heapify, heappush
    import math
    N, K = map(int, input().split())
    A = [int(i) for i in input().split()]
    F = [int(i) for i in input().split()]
    ans = 0
    A.sort(reverse=True)
    F.sort()
    s = []
    for i in range(N):
        s.append([A[i]*F[i], A[i], F[i]])
    s.sort(reverse=True, key=lambda x: x[0])

    def f(S, T):
        cur = 0
        num = 0
        while cur <= K:
            if num == N:
                break
            a, b, c = S[num]
            if a <= T:
                break
            cur += math.ceil((a - T)/c)
            num += 1
        if cur <= K:
            return True
        else:
            return False

    ok, ng = s[0][0], -1
    while abs(ok-ng) > 1:
        mid = (ok+ng)//2
        if f(s, mid) == True:
            ok = mid
        else:
            ng = mid
    print(ok)

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

n,k=map(int, input().split())
h=list(map(int,input().split()))
dp=[0]*(n)
if k+1<=n:
  max=k+1
else:
  max=n
for i in range(1,max):
  dp[i]=abs(h[0]-h[i])

for i in range(k,n):
  min=abs(h[i]-h[i-k])+dp[i-k]
  
  for ik in range(i-1,i-k-1,-1):
    if min >= abs(h[i]-h[ik])+dp[ik]:  
      min=abs(h[i]-h[ik])+dp[ik]
  dp[i]=min
  
print(dp[-1])

### FIXED CODE ###

n,k=map(int, input().split())
h=list(map(int,input().split()))
dp=[0]*(n)
if k+1<=n:
  max=k+1
else:
  max=n
  
for i in range(1,max):
  dp[i]=abs(h[0]-h[i])

for i in range(k,n):
  li=[abs(h[i]-h[ik])+dp[ik] for ik in range(i-1,i-k-1,-1) ]
  dp[i]=min(li)
  
print(dp[-1])
### BUGGY CODE ###

h, w = map(int, input().split())
diff = [list(map(int, input().split())) for _ in range(h)]
for i in range(h):
    for j, b in enumerate(list(map(int, input().split()))):
        diff[i][j] = abs(diff[i][j] - b)
dp = [[set() for j in range(w+1)] for i in range(h+1)]
dp[1][1].add(diff[0][0])

for i in range(1, h+1):
    for j in range(1, w+1):
        for x in dp[i-1][j]:
            dp[i][j].add(abs(x+diff[i-1][j-1]))
            dp[i][j].add(abs(x-diff[i-1][j-1]))
        for x in dp[i][j-1]:
            dp[i][j].add(abs(x+diff[i-1][j-1]))
            dp[i][j].add(abs(x-diff[i-1][j-1]))

print(min([abs(x) for x in dp[h][w]]))


### FIXED CODE ###

tdlist = lambda i, j, value=0: [[value] * j for _ in range(i)]

h, w = map(int, input().split())
D = 160*80
D2 = D*2+1

diff = [list(map(int, input().split())) for _ in range(h)]
for i in range(h):
    for j, b in enumerate(list(map(int, input().split()))):
        diff[i][j] = abs(diff[i][j] - b)

dp = tdlist(h, w)
dp[0][0] |= 1 << D+diff[0][0]
dp[0][0] |= 1 << D-diff[0][0]

for i in range(h):
    for j in range(w):
        if j:
            dp[i][j] |= dp[i][j-1] << diff[i][j]
            dp[i][j] |= dp[i][j-1] >> diff[i][j]
        if i:
            dp[i][j] |= dp[i-1][j] << diff[i][j]
            dp[i][j] |= dp[i-1][j] >> diff[i][j]

ans = float("inf")
for i in range(D2):
    if dp[h-1][w-1] >> i & 1:
        ans = min(ans, abs(i-D))
print(ans)
### BUGGY CODE ###


n = int(input())
data = [int(input()) for k in range(n)]
for i in range(n):
	data2 = data.copy()
	data2[i] = 0
	data2.sort()
	print(data2[-1])


### FIXED CODE ###

n = int(input())
data = [int(input()) for k in range(n)]
m1,m2 = sorted(data, reverse=1)[:2]
b = [m2 if x==m1 else m1 for x in data]
print('\n'.join(map(str,b)))
### BUGGY CODE ###

N, M, K = map(int, input().split())
relate = [[0] * N for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    relate[a][b] = 1
    relate[b][a] = 1
from collections import deque
# g : グラフ
# 例 [[1], [0, 2], [1, 3], [2, 4], [3, 5], [4, 6], [5, 7], [6, 8], [7, 9], [8]]
# i : 始点
def bfs(s):

    #訪れたかどうか
    d = [False] * N
    #初期設定
    que = deque()
    que.append(relate[s])
    d[s] = True
    
    while que:
        p = que.popleft()
        for i, j in enumerate(p):
            if j == 0 or d[i]:
                continue
            else:
                d[i] = True
                que.append(relate[i])
    return d
import copy
d = [bfs(i) for i in range(N)]
block_d = copy.deepcopy(d)
for i in range(K):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    block_d[a][b] = 0
    block_d[b][a] = 0
for i in range(N):
    d[i][i] = 0
    block_d[i][i] = 0
    print(sum(block_d[i]) - sum(relate[i]))

### FIXED CODE ###

N, M, K = map(int, input().split())
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

d = UnionFind(N)
num_fri = [0] * N
for i in range(M):
    a, b = map(int, input().split())
    d.union(a - 1, b - 1)
    num_fri[a - 1] += 1
    num_fri[b - 1] += 1
#num = [d.size(i) for i in range(N)]
for i in range(K):
    a, b = map(int, input().split())
    if d.same(a - 1, b - 1):
        num_fri[a - 1] += 1
        num_fri[b - 1] += 1
for i in range(N):
    print((d.size(i) - 1) - num_fri[i], end=' ')
### BUGGY CODE ###

# 20/4/20 Youtube解説の方法
n = int(input())
s = input()

ans = 0
for i in range(1000):
    t = list(str(i).zfill(3))
    ti = 0
    for j in range(n):
        if s[j] == t[ti]:
            ti += 1
            if ti == 3: break
    else:
        continue
    ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
S = input()

pin1 = {}
pin12 = {}
pin123 = {}

for i in range(N):
    if S[i] not in pin1:
        pin1[S[i]] = 1
        for j in range(i + 1, N):
            if S[i] + S[j] not in pin12:
                pin12[S[i] + S[j]] = 1
                for k in range(j + 1, N):
                    if S[i] + S[j] + S[k] not in pin123:
                        pin123[S[i] + S[j] + S[k]] = 1

print(len(pin123))
### BUGGY CODE ###

n, m = map(int, input().split())
data = [[int(e) for e in input().split()] for _ in range(n)]
d1 = {}
for i in range(n):
  if data[i][0] in d1:
    d1[data[i][0]].append(data[i][1])
  else:
    d1[data[i][0]] = [data[i][1]]
result = 0
d2 = {}
for i in range(1, m + 1):
  if i in d1:
    for j in d1[i]:
      if j in d2:
        d2[j] += 1
      else:
        d2[j] = 1
  else:
    if len(d2) == 0:
      continue
  maxb = max(d2.keys())
  result += maxb
  if d2[maxb] == 1:
    del d2[maxb]
  else:
    d2[maxb] -= 1
print(result)


### FIXED CODE ###

n, m = map(int, input().split())
d1 = {}
for _ in range(n):
  a, b = map(int, input().split())
  if a in d1:
    d1[a].append(b)
  else:
    d1[a] = [b]
result = 0
d2 = {}
maxb = -1
for i in range(1, m + 1):
  if i in d1:
    for j in d1[i]:
      if j not in d2:
        d2[j] = 0
      d2[j] += 1
      if j > maxb:
        maxb = j
  else:
    if len(d2) == 0:
      continue
  result += maxb
  if d2[maxb] == 1:
    del d2[maxb]
    if len(d2) == 0:
      maxb = 0
    else:
      maxb = max(d2.keys())
  else:
    d2[maxb] -= 1
print(result)
### BUGGY CODE ###

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

import itertools

ans=3*(10**9)
for i in range(N-1):
  l=list(itertools.accumulate(A))[i]
  D=abs(l-(sum(A)-l))
  if ans > D:
    ans=D

print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
 
import numpy as np

def getNearestValue(list, num):
  idx = np.abs(np.asarray(list) - num).argmin()
  return list[idx]

a=(np.cumsum(A))
l=getNearestValue(a, sum(A)/2)

ans=abs(sum(A)-2*l)
print(ans)
### BUGGY CODE ###

def main():
    n = int(input())
    S = input()

    ans = 10**9
    for i in range(len(S)):
        ans = min(ans, S[:i].count('W')+S[i+1:].count('E'))
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    S = input()

    array = [0,S[1:].count('E')]
    ans = sum(array)

    for i in range(1,len(S)):
        if S[i-1]=='W':
            array[0]+=1
        if S[i]=='E':
            array[1]-=1
        ans = min(ans, sum(array))
    print(ans)


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

import sys
input=sys.stdin.readline
import collections
import bisect

def main():
    _,M=map(int,input().split())
    A = list(map(int, input().split()))
    A.sort()
    while M>0:
        a = A.pop()
        if a == 0:
            print(0)
            return
        a //= 2
        M -= 1
        bisect.insort(A, a)
    print(sum(A))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input=sys.stdin.readline
import heapq

def main():
    _,M=map(int,input().split())
    A = []
    for a in list(map(int, input().split())):
        heapq.heappush(A, -a)
    while M>0:
        a = -heapq.heappop(A)
        a //= 2
        M -= 1
        heapq.heappush(A, -a)
    print(-sum(A))

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

def Solve(c,s):
    if s:
        for i in range(9):
            if c[i]>4:return False
            elif c[i]>=2:
                cc=c[:]
                cc[i]-=2
                if Solve(cc,False):return True
    else:
        if c.count(0)+c.count(3)==9:return True
        else:
            for i in range(9):
                if c[i]<0:return False
                elif c[i]>=1 and i<7:
                    cc=c[:]
                    for j in range(3):
                        cc[i+j]-=1
                    if Solve(cc,False):return True
_in=""
while True:
    ans=[]
    try:_in="9118992346175"
    except EOFError:break
    for i in range(9):
        l=sorted((_in+str(i+1))[::1])
        count=[l.count(str(j+1))for j in range(9)]
        if Solve(count,True):ans.append(str(i+1))
    print(0 if len(ans)==0 else " ".join(ans))

### FIXED CODE ###

def Solve(c,s):
    if s:
        if max(c)>4:return False
        for i in range(9):
            if c[i]>=2:
                cc=c[:]
                cc[i]-=2
                if Solve(cc,False):return True
    else:
        check=0
        for i in range(4):check+=c.count(3*i)
        if check==9:return True
        else:
            for i in range(7):
                if c[i]>=1:
                    cc=c[:]
                    isneg=False
                    for j in range(3):
                        cc[i+j]-=1
                        if cc[i+j]<0:
                            isneg=True
                            break
                    if isneg==False and Solve(cc,False):return True
_in=""
while True:
    ans=[]
    try:_in=input()
    except EOFError:break
    for i in range(9):
        l=(_in+str(i+1))[::1]
        count=[l.count(str(j+1))for j in range(9)]
        if Solve(count,True):ans.append(str(i+1))
    print(0 if len(ans)==0 else " ".join(ans))
### BUGGY CODE ###

import sys
n = int(input())
a = list(map(int,input().split()))
ans = set()
for i in range(n-1,-1,-1):
    c = 0
    for v in ans:
        if v%(i+1)==0:
            c+=1
    if a[i] ==0 and c%2==1:
        ans.add(i+1)
    if a[i] == 1 and c % 2 == 0:
        ans.add(i + 1)
ret = list(ans)
print(len(ret))
for v in ret:
    sys.stdout.write('{} '.format(v))

### FIXED CODE ###

import sys,math
n = int(input())
a = list(map(int,input().split()))
select = [0 for _ in range(n+1)]
mark = [0 for _ in range(n+1)]
c = 0
for i in range(n-1,0,-1):
    if a[i] ==0 and mark[i+1]%2==1:
        c += 1
        select[i + 1] = 1
        l = 1
        r = (i + 1)
        m = math.sqrt(i+1)
        m = int(m)
        while (l <=m):
            if (i + 1) % l == 0:
                mark[l] += 1
                r = (i + 1) // l
                if l != r:
                    mark[r] += 1
            l += 1
    if a[i] and mark[i+1]%2==0:
        c+=1
        select[i + 1] = 1
        l = 1
        r = (i + 1)
        m = math.sqrt(i + 1)
        m = int(m)
        while (l <= m):
            if (i + 1) % l == 0:
                mark[l] += 1
                r = (i + 1) // l
                if l!=r:
                    mark[r] += 1
            l += 1
if a[0]==0 and mark[1]%2==1:
    c+=1
    select[1]=1
    mark[1]+=1
elif a[0]==1 and mark[1]%2==0:
    c += 1
    select[1] = 1
    mark[1] += 1
print(c)
for i in range(1,n+1):
    if select[i]:
        sys.stdout.write('{} '.format(i))
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
b = 0
for m in range(n-1):
    d = sum(a[m+1:n])
    b = b + a[m]*d
    if b >= 10**9+7:
        b = b % (10**9+7)
print(b)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = 0
d = sum(a)
for m in range(n-1):
    d = d -a[m]
    b = b + a[m]*d
    if b >= 10**9+7:
        b = b % (10**9+7)
print(b)