Problem:
 Score : 300 points    Problem Statement There are 3N participants in AtCoder Group Contest .
The strength of the i -th participant is represented by an integer a_i .
They will form N teams, each consisting of three participants.
No participant may belong to multiple teams.  The strength of a team is defined as the second largest strength among its members.
For example, a team of participants of strength 1 , 5 , 2 has a strength 2 , and a team of three participants of strength 3 , 2 , 3 has a strength 3 .  Find the maximum possible sum of the strengths of N teams.      Constraints  1 ≤ N ≤ 10^5  1 ≤ a_i ≤ 10^{9}  a_i are integers.         Input Input is given from Standard Input in the following format:  N  a_1  a_2  ...  a_{3N}       Output Print the answer.        Sample Input 1 2
5 2 8 5 1 5      Sample Output 1 10  The following is one formation of teams that maximizes the sum of the strengths of teams:   Team 1 : consists of the first, fourth and fifth participants.  Team 2 : consists of the second, third and sixth participants.        Sample Input 2 10
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000      Sample Output 2 10000000000  The sum of the strengths can be quite large.

Solution (Python):
import sys

INF = 1001001001

def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  a.sort(reverse=True)
  ans = 0
  for i in range(n):
    ans += a[2*i + 1]
  print(ans)

  return

if __name__ == "__main__":
  resolve()

Solution (Python):
N=int(input())
*A,=map(int, input().split())
A.sort(reverse=True)
ans=0
for i in range(1,2*N,2):
    ans += A[i]
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A.sort()

B = A[N::][::2]
print(sum(B))

Solution (Python):


N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
idx = 1
ans = 0
for i in range(N):
    ans += A[idx]
    idx += 2
print(ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a.sort()
print(sum(a[n:3*n:2]))

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
print(sum(A[1:2*N:2]))

Solution (Python):
def solve():
    n = int(input())
    a= list(map(int,input().split()))
    a = sorted(a,reverse=True)
    res = sum(a[1:2*n:2])
    print(res)
if __name__=='__main__':
    solve()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=1)
ans=0
for i in range(1,2*n+1,2):ans+=a[i]
print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
A = a[1:len(a):2]
ans = 0
for i in range(N):
    ans += A[i]
print(ans)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
for i in range(2*n):
    if i%2 == 1:
        ans += A[i]
print(ans)

Solution (Python):
N = int(input())
a = sorted(list(map(int, input().split())))[::-1]

ans = 0
for i in range(N):
    ans += a[2*i+1]

print(ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)[::-1]
cnt = 0
res = 0
for i in range(1, n * 3 + 1, 2):
    cnt += 1
    res += a[i]
    if cnt >= n:
        break
print(res)

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

A.sort(reverse=True)
ans = 0
for i, a in enumerate(A[:2 * N]):
    if i % 2 != 0:
        ans += a

print(ans)

Solution (Python):
import sys
 
N = int(sys.stdin.readline())
a = sorted(list(map(int, sys.stdin.readline().split(" "))), reverse=True)
sum = 0
for i in range(N):
  sum += a[2 * i + 1]
print(sum)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
ans = 0
for i in range(1,n+1):
    ans += a[i*2-1]
print(ans)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = sorted(iil(),reverse=True)[1::2]
print(sum(A[:n]))

Solution (Python):
def solve():
    N = int(input())
    A = list(map(int,input().split()))

    A.sort(reverse=True)
    A = A[:N*2]
    print(sum(A[1::2]))

if __name__ == '__main__':
    solve()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import groupby, 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 fractions import gcd
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(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
a = LIST()
a.sort()
b = a[N:][::2]
print(sum(b))

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l.sort()
print (sum(l[n::2]))

Solution (Python):
si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
lmii = lambda: list(map(int, input().split()))
smii = lambda: sorted(map(int, input().split()))


N = ii()
A = smii()

ans = 0
for i in range(N, N * 3, 2):
    ans += A[i]

print(ans)

Solution (Python):
N = int(input())
A = sorted(list(map(int, input().split())))

print(sum([A[-i] for i in range(2, 2*N+1, 2)]))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
c=Counter(a)
ans,nokori=0,0
c=sorted(c.items(),reverse=True)
for k,v in c:
  cnt=min((v+nokori)//2,n)
  n-=cnt
  ans+=int(k)*cnt
  nokori=(v+nokori)%2
print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
l = len(a)
a.sort(reverse=True)
ans = 0
cnt = 0
for i in range(1,l,2):
  ans += a[i]
  cnt += 1
  if cnt == N: break
print(ans)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
A.sort()
A.reverse()
ans=int(0)
for i in range(n):
    ans+=A[2*i+1]
print(ans)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.sort()
A.reverse()
ans = 0
for i in range(1,2*N+1,2):
    ans += A[i]
print(ans)

Solution (Python):
N = int(input())
a = sorted(list(map(int, input().split())))[::-1]

ans = 0
for i in range(N):
    ans += a[1+2*i]

print(ans)

Solution (Python):
N = int(input())
a = sorted(list(map(int, input().split())))
ans = []

for i in range(1, N + 1):
  ans.append(a[i * (-2)])

print(sum(ans))

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

a.sort(reverse=True)

second = 0
for i in range(2*n):
    if i%2 != 0:
        second += a[i]
print(second)

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

a.sort(reverse=True)

second = []
for i in range(2*n):
    if i%2 != 0:
        second.append(a[i])
print(sum(second))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort()

ans = 0
for i in range(N):
    ans += a[len(a)-2-i*2]
print(ans)

Solution (Python):
from sys import stdin
input = stdin.readline

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

A.sort(reverse=True)

ans = 0

for i in range(1, 2 * N, 2):
    
    ans += A[i]

print(ans)

Solution (Python):


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


A.sort()
A.reverse()
X=0
for i in range(N):
    X+=A[2*i+1]
    
print(X)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v.sort(reverse = True)
s = 0
for i in range(0, n):
  s += v[1+2*i]
print(s)

Solution (Python):
N = int(input())
a = list(map(int,(input().split())))
a.sort(reverse=True)
ans = 0
for i in range(1,N*2,2):
    ans += a[i]
print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(N):
    ans += a[2*i+1]
print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(1, 2 * N, 2):
    ans += a[i]

print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a = sorted(a)

a1, a2, a3 = [], [], []
for i in range(N):
    a1.append(a[i])
    a3.append(a[-(2*i+1)])
    a2.append(a[-(2*i+2)])

print(sum(a2))

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

a = l()

a.sort(reverse = True)

po = 0

for i in range(2 * n):
    if i % 2:
        po += a[i]
print(po)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
ans = 0
for i in range(n):
    ans += a[2 * i + 1]
print(ans)

Solution (Python):

from collections import Counter
def inputlist(): return [int(j) for j in input().split()]

N = int(input())
a = inputlist()
a.sort()
a.reverse()
ans = 0
for i in range(N):
    j = 2*i+1
    ans += a[j]
print(ans)

Solution (Python):
n = int(input())
li = list(map(int,input().split()))

li.sort()


ans = 0
for i in range(n):
    li.pop()
    ans += li.pop()
    
print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = sorted(tuple(map(int, readline().split())), reverse=True)
cnt = 0
for i in range(n):
    cnt += a[i * 2 + 1]
print(cnt)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
ans = 0
for i in range(n):
  ans += a[2*i+1]
print(ans)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
print(sum(sorted(a)[N::2]))

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

a.sort()
del a[:n]

total = 0
for i in range(0, n*2, 2):
  total += a[i]

print(total)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
ans = 0
for i in range(n):
  ans += a[2*i+1]
print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
ans = 0
for i in range(n):
  ans += a[2*i+1]
print(ans)

Solution (Python):
n=int(input())
a=[int(x) for x in input().split()]

a.sort()
a.reverse()
print(sum(a[1:2*n:2]))

Solution (Python):
N = int(input())
arr = sorted(list(map(int, input().split())))
ans = 0
count =  0
for i in range(N,3*N):
    if count % 2 == 0:
        ans += arr[i]
    count += 1
print(ans)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
A.sort()
A = A[n:]
res = 0
for i in range(n):
    res += A[i*2]
print(res)

Solution (Python):

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

a.sort()
del a[:n]
print(sum(a[0::2]))

Solution (Python):
N = int(input()) 
a = sorted(list(map(int, input().split())))

print(sum(a[N::2]))

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
B=sorted(A)
ans=0
for i in range(N):
  ans+=B[N+2*i]

print(ans)

Solution (Python):
N = int(input())
A=list(map(int,input().split()))
A.sort()
ans = sum(A[N::2])
print(ans)

Solution (Python):
n = int(input())


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

sum = 0
cnt = 0
a.sort(reverse=True)

for i in range(1,len(a),2):
    sum += a[i]
    cnt += 1
    if cnt == n:
        break

print(sum)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
A = sorted(A)[::-1]
t = 0
for i in range(n):
    t += A[2*i + 1]
print(t)

Solution (Python):
s=int(input())
i= list(map(int, input().split()))
i.sort(reverse=True)
sum=0
for j in range(s):
    sum+=i[(2*j)+1]
print(sum)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)


print(sum( a[1:2*N:2] ))

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort()
print(sum(l[n::2]))

Solution (Python):
N = int(input())
a = sorted(map(int, input().split())) [::-1]
ans = 0
cnt = 0
for i in range(0, 3*N, 2):
  ans += a[i+1]
  cnt += 1
  if cnt == N:
    break
print(ans)

Solution (Python):
N = int(input())
a = sorted(map(int, input().split())) [::-1]
ans = 0
cnt = 0
for i in range(0, 3*N, 2):
  ans += a[i+1]
  cnt += 1
  if cnt == N:
    break
print(ans)

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

num = 0
a.sort(reverse=True)
i = 1
j = 0
while j < n:
    num += a[i]
    i += 2
    j += 1
print(num)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum([a[i] for i in range(n,3*n,2)]))

Solution (Python):
N = int(input())

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

print(sum(a[N::2]))

Solution (Python):
N=int(input())
L=list(map(int,input().split()))

L.sort()
L=L[N:]
ans=sum(L[::2])
print(ans)

Solution (Python):


N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
    ans += A[2*i+1]

print(ans)

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

print(sum(sorted(a, reverse=True)[1 : n * 2 : 2]))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)



cA = 0
for j in range(2, 2 * N + 1, 2):
    cA += A[-j]
print(cA)

Solution (Python):

import sys

def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    N = INT()
    A = LI()
    A.sort()
    answer = 0
    for i in range(N):
        answer += A[N+2*i]
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    groups = int(input())
    strength = list(map(int, input().split()))
    strength.sort()
    answer = 0
    for i in range(-2, -2 * groups - 2, -2):
        answer += strength[i]
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

n = int(input())

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

a.sort()

max_sum = 0
for i in range(n):
    max_sum += a[3*n - 2*(i+1)]

print("{}".format(max_sum))

Solution (Python):
N = int(input())
A = sorted(list(map(int, input().split())))

Ans = sum(A[N::2])
print(Ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
ans=0

for i in range(n*2):
  if (i+1)%2 == 0:
    ans += a[i]

print(ans)

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

a.sort(reverse=True)
a = a[:2*n]
ans = 0
for i in range(1,2*n,2):
    ans += a[i]
print(ans)

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
A.sort()

ans = 0
for _ in range(N):
    MAX = A.pop()
    MID = A.pop()
    ans += MID

print(ans)

Solution (Python):


n = int(input().rstrip())

numbers = list(reversed(sorted(map(int, input().rstrip().split(" ")))))

ans = 0
for i in range(n):
    ans += numbers[i*2+1]

print(ans)

Solution (Python):
n=int(input())
x=list(map(int, input().split()))
x.sort(reverse=True)

ans=0
for i in range(n):
	ans=ans+x[(i*2)+1]

print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)
ans = 0
for i in range(1, len(a)-N):
    if i % 2 == 1:
        
        ans += a[i]
print(ans)

Solution (Python):



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


a_list = sorted(a_list, reverse=True)
a_max = 0


for i in range(2*N): 
    if not i%2==0:
        a_max += a_list[i]

print(a_max)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
a = LIST()
a.sort(reverse=True)
ans = 0
for i in range(1, 2 * n, 2):
    ans += a[i]
print(ans)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
a=a[n:]
print(sum(a[::2]))

Solution (Python):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    ans = 0
    for i in range(n, 3*n, 2):
        ans += a[i]
    print(ans)

if __name__ == "__main__":
    main()

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

a.sort(reverse=True)

ans = 0
for i in range(n):
    ans += a[2*i + 1]
    
print(ans)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

a.sort(reverse=True)
ans=[]
for i in range(1,N+1):
    ans.append(a[i*2-1])
print(sum(ans))

Solution (Python):
N=int(input())
a=sorted(list(map(int, input().split())),reverse=True)
ans=[]
for i in range(1,N+1):
    ans.append(a[i*2-1])
print(sum(ans))

Solution (Python):
n = int(input())
li_a = list(map(int, input().split()))

print(sum(sorted(li_a)[n::2]))

Solution (Python):
N = int(input())
A_list = list(map(int, input().split()))
A_list = sorted(A_list, reverse = True)
A_list1 = A_list[0:2*N]
A_list2 = A_list[2*N:3*N]
print(sum(A_list1[1:2*N:2]))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
print(sum(a[1:3*n-n:2]))

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.sort()

ans = 0
j = 0
for i in range(N,3*N):
    if j%2==0:
        ans += A[i]
    j += 1
print(ans)

Solution (Python):
N = int(input())
a = map(int,input().split())
a = sorted(a,reverse=True)
print(sum(a[1:2*N:2]))

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

A.sort()
total = 0
for i in range(N):
  
  total += A[N + 2*i]

print(total)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
ans = 0
if N ==1:
    print(a[1])
else:
    for n in range(N):
        ans += a[2*n+1]
    print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[n::2]))

Solution (Python):
n = int(input())
print(sum(sorted(list(map(int, input().split())))[n::2]))

Solution (Python):
n=int(input())
*a,=map(int,input().split())
a.sort()
print(sum(a[n::2]))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
ans=0
for i in range(n):
    ans+=a[2*i+1]
print(ans)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))

a.sort(reverse=True)
c=0
for i in range(N):
    c=c+a[2*i+1]
print(c)

Solution (Python):
n = int(input())
elem = list(map(int, input().split()))
elem.sort()
ans = sum(elem[n::2])
print(ans)

Solution (Python):
n = int(input())
dat = list(map(int, input().split()))
dat.sort(reverse=True)

s = 0
for i in range(n):
    s += dat[2 * i + 1]
print(s)

Solution (Python):
N,*A=map(int, open(0).read().split())
print(sum(sorted(A)[N::2]))

Solution (Python):
n = int(input()) 
a = list(map(int, input().split(' ')))

sa = sorted(a,reverse=True)[0:2 * n]

cs = sa[1::2]

print(sum(cs))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
print(sum(a[n::2]))

Solution (Python):
N=int(input())
a = sorted(list(map(int,input().split())),reverse=True)
ans=0
for i in range(N):
  ans+=a[2*i+1]
print(ans)

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

A.sort(reverse=True)


ans = 0
for i, ai in enumerate(A):
    if i % 2 == 1 and i < 2 * N:
        
        ans += ai
print(ans)

Solution (Python):
N = int(input())
A=input().split()
A=[int(a) for a in A]

sum=0
A.sort(reverse=True)
for a in A[1:2*N:2]:
    sum+=a
    
print(sum)

Solution (Python):
N = int(input())
list = [int(i) for i in input().split()]

list.sort(reverse = True)
temp = 0
for i in range(N):
  temp += list[1+2*i]

print(temp)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
A.sort()
A.reverse()
ans=0
for i in range(N):
  ans+=A[2*i+1]
print(ans)

Solution (Python):
def main():
    N = int(input())
    a = sorted(list(map(int,input().split())),reverse=True)
    ans = 0
    for i in range(1,2*N,2):
        ans += a[i]
    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
a = sorted(list(map(int,input().split())))
A = [a[i] for i in range(N,3 * N)]

ans = 0

for i in range(0,N):
  ans += A[i * 2]
  
print(ans)

Solution (Python):




n = int(input().strip())
a_list = list(map(int, input().rstrip().split()))

a_list.sort()
a2_list = a_list[n:]

sum=0
for i in range( 0,len(a2_list),2 ):
    sum += a2_list[i]

print(sum)

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a_list = list(map(int, input().split()))
    a_list.sort(reverse=True)
    ans = 0
    for i in range(N):
        ans += a_list[2 * i + 1]
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
list_a = [int(x) for x in input().split()]

list_a.sort(reverse = True)
ans = 0

for i in range(N) :
    ans += list_a[2*i+1]

print(ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
power = 0

for i in range(N):
  power += a[2*i + 1]
  
print(power)

Solution (Python):
def examA():
    N = I()
    A = LI()
    A.sort()
    ans = 0
    for i in range(N):
        ans += A[-i*2-2]
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examA()

"""

"""

Solution (Python):
N = int(input())
lst = [int(i) for i in input().split(" ")]

lst.sort(reverse = True)
temp = 0

for i in range(0,N):
  temp += lst[1+2*i]

print(temp)

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

a.sort(reverse=True)

print(sum(a[1:2*n:2]))

Solution (Python):
n = int(input())
aList = list(map(int, input().split()))
aList.sort()
aList = aList[n:]
sums = 0
for i in range(2 * n):
    if i % 2 == 0:
        sums += aList[i]
print(sums)

Solution (Python):
N = input()
print sum(sorted(map(int, raw_input().split()))[N::2])

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

A.sort(reverse = True)
ans = []
for i in range(int(len(A)/3)): 
    ans.append(A[1+2*i])
print(sum(ans))

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
print(sum(A[1:2*n:2]))

Solution (Python):
n = int(input())
a = [int(_) for _ in input().split()]
a.sort()
print(sum(a[n:3*n:2]))

Solution (Python):
try:
  N = int(input())
  a = list(map(int, input().split()))
  a_ = sorted(a)
  __ = a_[N:]
  b = sorted(__, reverse=True)
  c = [b[i] for i in range(len(b)) if i%2!=0]
  print(sum(c))
except EOFError:
  pass

Solution (Python):
N = int(input())
array = sorted(list(map(int, input().split())),reverse = True)
a = []
for i in range(N):
  a.append(array[i*2+1])
print(sum(a))

Solution (Python):
import sys
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
a_ls.sort(reverse=True)
print(sum(a_ls[1::2][:n]))

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





n=ii()
arr=limii()

arr.sort(reverse=True)


ans=0
for i in range(1,n+1):
    ans+=arr[2*i -1]
print(ans)

Solution (Python):
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)

ans = 0
for i in range(0,N*2,2):

    ans += A[i+1]
print(ans)

Solution (Python):
N = int(input())
a_lst = [int(x) for x in input().split()]

a_lst.sort(reverse=True)

sum = 0
for i in range(1, 2*N, 2):
    sum += a_lst[i]
print(sum)

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

A.sort()
print(sum(A[N:3 * N:2]))

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
a.sort(reverse=True)
print(sum(a[1:2*n][::2]))

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def sign(n):
        if n == 0:
            return 0
        if n < 0:
            return -1
        return 1

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.__q = l
        heapq.heapify(self.__q)
        return

    def push(self, n):
        heapq.heappush(self.__q, n)
        return

    def pop(self):
        return heapq.heappop(self.__q)


MOD = int(1e09) + 7
INF = int(1e15)


def main():
    
    N = Scanner.int()
    A = Scanner.map_int()
    A.sort(reverse=True)
    print(sum(A[1:N * 2:2]))
    return


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
array = sorted(list(map(int, input().split())),reverse = True)
a = []
for i in range(N):
  a.append(array[i*2+1])
print(sum(a))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a.sort()


a = a[N::2]
print(sum(a))

Solution (Python):
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    
    a.sort(reverse = True)
    ans = 0
    for i in range(N):
        ans += a[2*i + 1]
    
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
sum = 0
for i in range(1,N*2,2):
	sum += A[i]
print(sum)

Solution (Python):
N = int(input())
A = sorted([int(n) for n in input().split()], reverse=True)
print(sum([x for x in A[1:2*N:2]]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
power=2
loop=0
ans=0
for i in range(1,(n*3)+1):
    if loop==n:
        print(ans)
        exit()
    elif power==i:
            ans+=a[i-1]
            power+=2
            loop+=1

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
    ans += A[2*i+1]
print(ans)

Solution (Python):
n = int(input())





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

a.sort()


print(sum(a[::-1][1:2*n:2]))

Solution (Python):


N = int(input())

a = list(map(int, input().rstrip().split()))
a.sort(reverse=True)

print(sum(a[1:2*N+1:2]))

Solution (Python):
N = int(input())
list3 = list(map(int, input().split()))
list4 = sorted(list3, reverse=True)
res = 0
for i in range(1,N*2,2): 
    res = res + sum(list4[i:i+1])
print(res)

Solution (Python):
n = int(input())

l = sorted([int(i) for i in input().split()],reverse = True)

ans = 0

for i in range(1,n*2,2):
    ans += l[i]
    
print(ans)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

A = sorted(a, reverse=True)
B = []
ans = 0
B = A[:2*N]
for i in range(int(len(B)/2)):
    ans += B[2*i+1]

print(ans)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
print(sum(a[n::2]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[n::2]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
r = 0
c = 0
for i in range(1, 3*n):
    if i%2 ==0:
        r += a[-i]
        c += 1
        if c == n:
            break
print(r)

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
ans = sum(a[n::2])
print(ans)