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

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

for i in range(N):
    if i < N-1:
        print(A.index(i+1) + 1, end=" ")
    else:
        print(A.index(max(A)) + 1)

### FIXED CODE ###

N = int(input())
A = {num: i+1 for i,num in enumerate(map(int, input().split()))}

for i in range(1, N+1):
    if i == N:
        print(A[i])
    else:
        print(A[i], end=" ")
### BUGGY CODE ###

import sys
sys.setrecursionlimit(1000000000)

def rec(n):
    if n == 1:
        return 1
    return rec(n-1) + 1


print(rec(700000))


### FIXED CODE ###

A, B = map(int, input().split())
print(max(A*2-1,A+B,B*2-1))
### BUGGY CODE ###

from collections import deque
p, q, r = deque, deque, deque

X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
tmp = 0
p.sort(reverse=True)
p.append(0)
q.sort(reverse=True)
q.append(0)
r.sort(reverse=True)
r.append(0)
z = X+Y
for i in range(z):
    if X>0 and ((p[0]>=q[0] and p[0]>=r[0]) or (Y==0 and p[0]>=r[0])):
        tmp = tmp+p[0]
        p.pop(0)
        X -= 1
    elif Y>0 and ((q[0]>=p[0] and q[0]>=r[0]) or (X==0 and q[0]>=r[0])):
        tmp = tmp+q[0]
        q.pop(0)
        Y -= 1
    elif r[0]>p[0] or r[0]>q[0]:
        tmp = tmp+r[0]
        r.pop(0)
        
print(tmp)

### FIXED CODE ###

X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
tmp = 0
p.sort(reverse=True)
p.append(0)
q.sort(reverse=True)
q.append(0)
r.sort(reverse=True)
r.append(0)
z = X+Y
e, f, g = 0, 0, 0
for i in range(z):
    if X>0 and ((p[e]>=q[f] and p[e]>=r[g]) or (Y==0 and p[e]>=r[g])):
        tmp = tmp+p[e]
        e += 1
        X -= 1
    elif Y>0 and ((q[f]>=p[e] and q[f]>=r[g]) or (X==0 and q[f]>=r[g])):
        tmp = tmp+q[f]
        f += 1
        Y -= 1
    elif r[g]>p[e] or r[g]>q[f]:
        tmp = tmp+r[g]
        g += 1
        
print(tmp)
### BUGGY CODE ###

import numpy as np
n=int(input())
x=np.array([int(item) for item in input().split()])

for i in range(n):
  ind = np.ones(n, dtype=bool)
  ind[i] = False
  
  print(int(np.median(x[ind])))

### FIXED CODE ###

n = int(input())
x = list(map(int,input().split()))
x_sorted = sorted(x)
pin = x_sorted[n//2]
pre = x_sorted[n//2 - 1]
for i in range(n):
  if x[i] < pin:
    print(pin)
  else:
    print(pre)
### BUGGY CODE ###

n = int(input())
ans = 1

for i in range(1, n + 1):
  ans *= i
  
print(ans % (10**9 + 7))

### FIXED CODE ###

n = int(input())
ans = 1
ex = 10**9 + 7
for i in range(1, n + 1):
  ans =  ans * i % ex

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

import collections as cl
import math


def combinations_count(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

cnt = cl.Counter(A)
ans = 0
mem = {}

for a in A:
    if a in mem:
        print(mem[a])
        continue
    ans = 0
    cnt[a] -= 1
    for v in cnt.values():
        if v < 2:
            continue
        ans += combinations_count(v, 2)
    cnt[a] += 1
    print(ans)


### FIXED CODE ###

import collections as cl
import math


def combinations_count(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

cnt = cl.Counter(A)
ans = 0
for v in cnt.values():
    ans += combinations_count(v, 2)

for a in A:
    print(ans - cnt[a]+1)
### BUGGY CODE ###

def main():
    N = int(input())
    P = list(map(float,input().split()))
    f = [[0]*(N + 1) for _ in range(N + 1)]
    f[0][0] = 1 - P[0]
    f[0][1] = P[0]
    for i in range(1,N):
        p = P[i]
        f[i][0] = f[i - 1][0]*(1 - p)
        for j in range(1,i + 2):
            f[i][j] += p*f[i - 1][j - 1] + (1 - p)*f[i - 1][j]
    print(sum(f[N - 1][N //2 + 1:]))
    return

if __name__ == "__main__":
    main()

### FIXED CODE ###

from math import ceil
def main():
    N = int(input())
    P = list(map(float,input().split()))
    f = [[0]*(N + 1) for _ in range(N + 1)]
    f[0][0] = 1 - P[0]
    f[0][1] = P[0]
    for i in range(1,N):
        p = P[i]
        f[i][0] = f[i - 1][0]*(1 - p)
        for j in range(max(1,ceil((N + 1)/2) - N + i - 3),i + 2):
            f[i][j] += p*f[i - 1][j - 1] + (1 - p)*f[i - 1][j]
    print(sum(f[N - 1][N //2 + 1:]))
    return

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

N, K, Q = [int(s) for s in input().split(' ')]
A = [int(input()) for s in range(Q)]

# syoki_tokuten = [K for s in range(N)]
syoki_tokuten = [0 for s in range(N)]

for i in A:
  syoki_tokuten[i-1] += 1
  
for i in range(N):
  genten = sum(syoki_tokuten) - syoki_tokuten[i]

  if genten < K:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

from collections import Counter 

N, K, Q = [int(s) for s in input().split(' ')]
A = [int(input()) - 1 for s in range(Q)]

c = Counter(A)

sum = sum(c.values())

for i in range(N):
  
  if sum - c[i] < K:
    print('Yes')
  else:
    print('No')
### BUGGY CODE ###

#! /usr/bin/env python3

import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,x,y = na()
ans = [0]*(n-1)

for j in range(1,n+1):
    for i in range(1,j):
        a = min(abs(i-j), abs(x-i)+1+abs(j-y), abs(y-i)+1+abs(j-x))
        ans[a-1] += 1

print(*ans, sep='\n')

### FIXED CODE ###

#! /usr/bin/env python3

import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,x,y = na()
ans = [0]*(n-1)

for j in range(1,n+1):
    for i in range(1,j):
        a = min(abs(i-j), abs(x-i)+1+abs(j-y), abs(y-i)+1+abs(j-x))
        ans[a-1] += 1

print(*ans, sep='\n')
### BUGGY CODE ###

N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
count = 0
for i in range(N+1):
    for t in range(N+1):
        if i<t:
            count+=1 if sum(A[i:t])%M==0 and sum(A[i:t]) != 0 else  0
print(count)


### FIXED CODE ###

import collections
import numpy as np

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

A = np.array(A,dtype='int64')
C = np.append([0],np.cumsum(A))
L = [i%M for i in C]
L_c = collections.Counter(L)

ans = 0
for i in L_c.values():
    S = i * (i-1) / 2
    ans+=S
    
print(int(ans))
### BUGGY CODE ###

def main():
    import bisect
    N, M = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    A.sort()
    for divcnt in range(M):
        tmp = (A.pop())//2
        for i in range(1,min(101,N)):
            if A[-i] < tmp:
                A.insert(-i+1,tmp)
                break
        else:
            bisect.insort(A,tmp)
    print(sum(A))
if __name__ == "__main__":
    main()

### FIXED CODE ###

from heapq import heappush,heappop,heapify
from math import ceil
def main():
    N, M = (int(i) for i in input().split())
    A = [-int(i) for i in input().split()]
    heapify(A)
    for divcnt in range(M):
        tmp = ceil(heappop(A)/2)
        heappush(A,tmp)
    print(-sum(A))
if __name__ == "__main__":
    main()
### BUGGY CODE ###

import sys
from collections import deque
from collections import defaultdict
import math
input = sys.stdin.readline
sys.setrecursionlimit(20000000)
h,w = map(int,input().split())
s = []
for i in range(h):
        a = [i for i in input().rstrip()]
        s.append(a)
ans = [[1]*w for i in range(h)]
x = [[0]*w for i in range(h)]
for i in range(h):
        for j in range(w):
                if s[i][j] == "." and 0<j and s[i][j-1] == ".":
                        x[i][j] = x[i][j-1] +1
                if s[i][j] == ".":
                        ans[i][j] += x[i][j]

x = [[0]*w for i in range(h)]
for i in range(h):
        for j in range(w-1,-1,-1):
                if s[i][j] == "." and w-1>j and s[i][j+1] == ".":
                        x[i][j] = x[i][j+1] +1
                if s[i][j] == ".":
                        ans[i][j] += x[i][j]
x = [[0]*w for i in range(h)]
for i in range(w):
        for j in range(h-1,-1,-1):
                if s[j][i] == "." and h-1>j and s[j+1][i] == ".":
                        x[j][i] = x[j+1][i] +1
                if s[j][i] == ".":
                        ans[j][i] += x[j][i]
x = [[0]*w for i in range(h)]
for i in range(w):
        for j in range(h):
                if s[j][i] == "." and 0<j and s[j-1][i] == ".":
                        x[j][i] = x[j-1][i] +1
                if s[j][i] == ".":
                        ans[j][i] += x[j][i]               
ans2 = 0
for i in range(h):
        for j in range(w):
                ans2 = max(ans2,ans[i][j])
print(ans2)

### FIXED CODE ###

import sys
from collections import deque
from collections import defaultdict
import math
input = sys.stdin.readline
sys.setrecursionlimit(20000000)
h,w = map(int,input().split())
s = []
for i in range(h):
        a = [i for i in input().rstrip()]
        s.append(a)
ans = [[1]*w for i in range(h)]
res = 0
for i in range(h):
        res = 0
        for j in range(w):
                if s[i][j] == "." and 0<j and s[i][j-1] == ".":
                        res = res +1
                if s[i][j] == ".":
                        ans[i][j] += res
                else:
                        res = 0

res = 0
for i in range(h):
        res = 0
        for j in range(w-1,-1,-1):
                if s[i][j] == "." and w-1>j and s[i][j+1] == ".":
                        res = res +1
                if s[i][j] == ".":
                        ans[i][j] += res
                else:
                        res = 0
res = 0
for i in range(w):
        res = 0
        for j in range(h-1,-1,-1):
                if s[j][i] == "." and h-1>j and s[j+1][i] == ".":
                        res = res+1
                if s[j][i] == ".":
                        ans[j][i] += res
                else:
                        res = 0
res = 0
for i in range(w):
        res = 0
        for j in range(h):
                if s[j][i] == "." and 0<j and s[j-1][i] == ".":
                        res = res +1
                if s[j][i] == ".":
                        ans[j][i] += res           
                else:
                        res = 0  
ans2 = 0
for i in range(h):
        for j in range(w):
                ans2 = max(ans2,ans[i][j])
print(ans2)
### BUGGY CODE ###

H,W = map(int,input().split())
maze = []
pad = ' ' * (W+2)
maze.append(pad)
for i in range(H):
  m = input()
  maze.append(' ' + m + ' ')
maze.append(pad)
  
def bfs(maze, x,y, score):
    queue = [(x,y,0)]
    visited = {}
    while queue:
      x,y,s = queue.pop(0)
      if maze[x][y] != '.':
        continue
      visited[(x,y)] = s
      if (x+1,y) not in visited:
        queue.append((x+1,y,s+1))
      if (x-1,y) not in visited:
        queue.append((x-1,y,s+1))
      if (x,y+1) not in visited:
        queue.append((x,y+1,s+1))
      if (x,y-1) not in visited:
        queue.append((x,y-1,s+1))
    return max(visited.values())
  
ans = -1
for h in range(1,H+1):
  for w in range(1,W+1):
    now = maze[h][w]
    if now == '#':
      continue
    count = 0
    if maze[h-1][w] == '.':
      count+=1
    if maze[h+1][w] == '.':
      count+=1
    if maze[h][w-1] == '.':
      count+=1
    if maze[h][w+1] == '.':
      count+=1
    if count > 2:
      continue
    a = bfs(maze,h,w,0)
    if a > ans:
      ans = a
print(ans)

### FIXED CODE ###

h,w = map(int,input().split())
maze = [input() for _ in range(h)]
from collections import deque
D = [(0,1),(1,0),(-1,0),(0,-1)]
ans = 0
for i in range(h):
  for j in range(w):
    if maze[i][j]=='#':
      continue
    queue  = deque([(i,j,0)])
    checked = [[0 for _ in range(w)] for _ in range(h)]
    checked[i][j] = 1
    while queue:
      j,k,d = queue.popleft()
      for dx,dy in D:
        x,y = j+dx,k+dy
        if not(0<=x<h) or not(0<=y<w):
          continue
        if maze[x][y] == '#':
          continue
        if checked[x][y]:
          continue
        checked[x][y] = d+1
        queue.append((x,y,d+1))
    for j in range(h):
      for k in range(w):
        if checked:
          ans = max(ans,checked[j][k])

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

from itertools import permutations as pe
n,m,r=map(int,input().split())
s=[[(0 if i==j else float("inf"))for j in range(n+1)]for i in range(n+1)]
g=list(pe(list(map(int,input().split()))))
for i in range(m):
    a,b,c=map(int,input().split())
    s[a][b]=c
    s[b][a]=c
for h in range(1,n+1):
    for i in range(1,n+1):
        for j in range(1,n+1):
            if s[i][j]>s[i][h]+s[h][j]:
                s[i][j]=s[i][h]+s[h][j]
k=float("inf")
for i in range(len(g)):
    d=g[i]
    c=0
    for j in range(1,len(d)):
        c+=s[d[j-1]][d[j]]
    else:
        k=min(c,k)
print(k)

### FIXED CODE ###

from itertools import permutations as pe
from scipy.sparse.csgraph import floyd_warshall as wf
n,m,r=map(int,input().split())
s=[[(0 if i==j else float("inf"))for j in range(n+1)]for i in range(n+1)]
g=list(pe(list(map(int,input().split()))))
for i in range(m):
    a,b,c=map(int,input().split())
    s[a][b]=c
    s[b][a]=c
s=wf(s,directed=False)
k=float("inf")
for i in range(len(g)):
    d=g[i]
    c=0
    for j in range(1,len(d)):
        c+=s[d[j-1]][d[j]]
        if c>=k:
            break
    else:
        k=min(c,k)
print(int(k))
### BUGGY CODE ###

def main():
  AC = 0
  WA = 0
  
  solving = {}
  solved = []
  
  N,M = map(int, input().split())
  
  P = [0] * M
  S = [0] * M
  
  for i in range(M):
    p, s = input().split()
    if p in solved:
      continue
    elif s == 'WA':
      if p in solving:
        _wa = solving[p]
        solving[p] = _wa + 1
      else:
        solving[p] = 1
    else:
      AC += 1
      if p in solving:
      	WA += solving[p]
      solved.append(p)
  
  print(AC, WA)
  return 0
 
if __name__ == "__main__":
  main()

### FIXED CODE ###

def main():
  AC = 0
  WA = 0
  
  solving = {}
  solved = {}
  
  N,M = map(int, input().split())
  
  for i in range(M):
    p, s = input().split()
    if p in solved:
      continue
    elif s == 'WA':
      if p in solving:
        _wa = solving[p]
        solving[p] = _wa + 1
      else:
        solving[p] = 1
    else:
      AC += 1
      if p in solving:
      	WA += solving[p]
      solved[p] = True
  
  print(AC, WA)
  return 0
 
if __name__ == "__main__":
  main()
### BUGGY CODE ###

N,Q = map(int,input().split())
S = str(input())
cnt0 = S.count("AC")
cnt = []

for i in range(0,N):
 sli = S[i:]
 cnt1 = sli.count("AC")
 cnt.append(cnt1)

for i in range(0,Q):
 l,r = map(int,input().split())
 ans = cnt[l-1] - cnt[r-1]
 print(ans)
S


### FIXED CODE ###

N,Q = map(int,input().split())
S = (input())
cnt = [0] * (N + 1)
for i in range(N):
 if S[i:i+2] == "AC":
  cnt[i+1] = cnt[i] + 1
 else:
  cnt[i+1] = cnt[i]

for i in range(0,Q):
 l,r = map(int,input().split())
 print(cnt[r-1] - cnt[l-1])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()


def resolve():
    N = int(input())

    i = 0
    print(i, flush=True)
    s = str(input())
    if s == 'Vacant':
        sys.exit()
    else:
        temp = s

    pl=0
    pr=N
    while pl <= pr:
        pc = (pl + pr) // 2
        print(pc, flush=True)

        s = str(input())
        if s == 'Vacant':
            sys.exit()
        elif s == 'Male':
            if (pc - pl) % 2 == 1 and temp != 'Male':
                temp = s
                pr = pc - 1
            else:
                temp = s
                pl = pc + 1
        else:
            if (pc - pl) % 2 == 1 and temp != 'Female':
                temp = s
                pr = pc - 1
            else:
                temp = s
                pl = pc + 1


resolve()

### FIXED CODE ###

N = int(input())


def query(i):
    print(i)
    s = input()
    if s == 'Vacant':
        exit()
    return s


root = query(0)


def is_ok(ind):
    # 左ならTrue
    response = query(ind)
    if ind % 2 == 1:
        return root == response
    else:
        return root != response


def bin_search_meguru():
    """
    初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
    まずis_okを定義すべし
    ng, okは,とり得る最小の値-1,とり得る最大の値+1
    """

    # 適当にいじる
    ng = -1  # ind=0が条件を満たすこともあるため
    ok = N  # ind=len(a)-1が条件を満たさないこともあるため

    # いじらない
    # okとngのどちらが大きいかわからないことを考慮
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return False


bin_search_meguru()
### BUGGY CODE ###

n,m=map(int,input().split())
cards=[i for i in range(n)]
for j in range(m):
    l,r=map(int,input().split())
    for i in range(l-1):
        cards[i]=-1
    for i  in range(r,n):
        cards[i]=-1

ans=sum(1 for cars in cards if cars>=0)
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
l=[]
r=[]
for j in range(m):
    templ,tempr=map(int,input().split())
    l.append(templ)
    r.append(tempr)
ans=min(r)-max(l)+1
if ans<0:
    ans=0
print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

MAXN = 1005
MAXV = MAXN*(MAXN-1)//2
to = [[] for _ in range(MAXV)] # 頂点間の辺の情報
id = [[[] for _ in range(MAXN)] for _ in range(MAXN)] # 試合のid=DAGの頂点番号
def toId(i,j): # 選手idから試合idを返す関数
    if i > j: # i,jが逆になっても試合idは同じ
        i,j = j,i
    return id[i][j]

visited = [False]*MAXV
calculated = [False]*MAXV
dp = [1]*MAXV # Vからスタートしたときの最長経路。頂点の個数ベースで経路の長さを数えるので、初期値は1

def dfs(v):
    if visited[v]:
        if not calculated[v]:
            return -1 # 計算が終わっていない頂点を2度訪れるのはループがあるということ
        return dp[v]
    visited[v] = True
    for u in to[v]: # 全ての辺をなめる
        res = dfs(u)
        if res == -1: return -1 # ループがあれば-1を返す
        dp[v] = max(dp[v], res+1)
    calculated[v] = True
    return dp[v]

def main():
    n = int(input())
    a = [[int(i) for i in readline().split()] for _ in range(n)]
    for i in range(n):
        for j in range(n-1):
            a[i][j] -= 1 # 選手idを0始まりに変換
    V = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                id[i][j] = V
                V += 1 # 0から順に各試合にidを割り振る
    for i in range(n):
        for j in range(n-1):
            a[i][j] = toId(i,a[i][j]) # 選手idを試合id(頂点番号)に置き換える
        for j in range(n-2): # 頂点間の依存関係はn-2個
            to[a[i][j+1]].append(a[i][j])
    ans = 0
    for i in range(V):
        res = dfs(i)
        if res == -1:
            print('-1') # ループがあれば-1を返す（問題文の指示）
            return
        ans = max(ans, res)
    print(ans)
    return

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

MAXN = 1005
MAXV = MAXN*(MAXN-1)//2
to = [[] for _ in range(MAXV)] # 頂点間の辺の情報
id = [[[] for _ in range(MAXN)] for _ in range(MAXN)] # 試合のid=DAGの頂点番号
def toId(i,j): # 選手idから試合idを返す関数
    if i > j: # i,jが逆になっても試合idは同じ
        i,j = j,i
    return id[i][j]

visited = [False]*MAXV
calculated = [False]*MAXV
dp = [1]*MAXV # Vからスタートしたときの最長経路。頂点の個数ベースで経路の長さを数えるので、初期値は1

def dfs(v):
    if visited[v]:
        if not calculated[v]:
            return -1 # 計算が終わっていない頂点を2度訪れるのはループがあるということ
        return dp[v]
    visited[v] = True
    for u in to[v]: # 全ての辺をなめる
        res = dfs(u)
        if res == -1: return -1 # ループがあれば-1を返す
        dp[v] = max(dp[v], res+1)
    calculated[v] = True
    return dp[v]

def main():
    n = int(input())
    a = [[int(i) for i in readline().split()] for _ in range(n)]
    for i in range(n):
        for j in range(n-1):
            a[i][j] -= 1 # 選手idを0始まりに変換
    V = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                id[i][j] = V
                V += 1 # 0から順に各試合にidを割り振る
    for i in range(n):
        for j in range(n-1):
            a[i][j] = toId(i,a[i][j]) # 選手idを試合id(頂点番号)に置き換える
        for j in range(n-2): # 頂点間の依存関係はn-2個
            to[a[i][j+1]].append(a[i][j])
    ans = 0
    for i in range(V):
        res = dfs(i)
        if res == -1:
            print('-1') # ループがあれば-1を返す（問題文の指示）
            return
        ans = max(ans, res)
    print(ans)
    return

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

def solve():
    from sys import stdin
    f_i = stdin
    
    mod = 10 ** 9 + 7
    
    N = int(f_i.readline())
    A = map(int, f_i.readline().split())
    
    bit_count = [0] * 60
    for A_i in A:
        b = 0
        while A_i:
            bit_count[b] += A_i & 1
            A_i >>= 1
            b += 1
    
    ans = 0
    bit = (1 << i for i in range(60))
    for b, c in zip(bit, bit_count):
        ans += b * c * (N - c)
    
    print(ans % mod)

solve()

### FIXED CODE ###

def solve():
    import numpy as np
    from sys import stdin
    f_i = stdin
    
    mod = 10 ** 9 + 7
    
    N = int(f_i.readline())
    A = np.array(f_i.readline().split(), dtype=np.int64)
    
    ans = 0
    for i in range(60):
        cnt = np.count_nonzero((A >> i) & 1)
        ans += (1 << i) * cnt * (N - cnt)
    
    print(ans % mod)

solve()
### BUGGY CODE ###

import math



N=int(input())

anslist=[]
for i in range(1,N+1):
    ans=0
    if i<=5:
        print(ans)
    else:
        ma=int(math.sqrt(i))
        mi=max(1,int(math.sqrt(i)/6))
        for x in range(mi,ma):
            for y in range(x,ma):
                for z in range(y,ma):
                    if x**2+y**2+z**2+x*y+y*z+z*x>i:
                        continue
                    if x**2+y**2+z**2+x*y+y*z+z*x==i:
                        if x==y and y==z:
                            ans+=1
                        elif x==y or y==z or z==x:
                            ans+=3
                        else:
                            ans+=6
            
        print(ans)

### FIXED CODE ###

import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

            
for i in range(1,N+1):
    print(anslist[i])
### BUGGY CODE ###

import sys

n = int(input())
d = list(input())

minNum = sys.maxsize

for i in range(n):
    count = 0
    if i == 0:
        newD = d[i+1:]
        for j in newD:
            if j == "E":
                count += 1
    elif i == n-1:
        newD = d[:i]
        for j in newD:
            if j == "W":
                count += 1
    else:
        left = d[:i]
        right = d[i+1:]
        for p in left:
            if p == "W":
                count += 1
        for q in right:
            if q == "E":
                count += 1
    if count < minNum:
        minNum = count

print(minNum)

### FIXED CODE ###

import sys

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

count = sys.maxsize
ans = S[1:].count("E")

for i in range(N-1):
    count = min(ans, count)
    if S[i] == "W":
        if S[i+1] == "W":
            ans += 1
    elif S[i] == "E":
        if S[i+1] == "E":
            ans -= 1

count = min(ans, count)
print(count)