As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made *n* snowballs with radii equal to *r*<sub class="lower-index">1</sub>, *r*<sub class="lower-index">2</sub>, ..., *r*<sub class="lower-index">*n*</sub>. To make a snowman, one needs any three snowballs whose radii are pairwise different. For example, the balls with radii 1, 2 and 3 can be used to make a snowman but 2, 2, 3 or 2, 2, 2 cannot. Help Sergey and his twins to determine what maximum number of snowmen they can make from those snowballs.
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the number of snowballs. The next line contains *n* integers — the balls' radii *r*<sub class="lower-index">1</sub>, *r*<sub class="lower-index">2</sub>, ..., *r*<sub class="lower-index">*n*</sub> (1 ≤ *r*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>). The balls' radii can coincide.
7
1 2 3 4 5 6 7
2
7 5 3
6 4 2
3
2 2 3
0
1
255317
0
6
1 1 2 2 3 3
2
3 2 1
3 2 1
6
1 2 2 2 3 3
1
3 2 1
6
1 1 2 2 2 2
0
6
1 2 2 3 3 3
1
3 2 1
6
1 1 1 2 2 3
1
3 2 1
14
1 1 2 2 3 3 4 4 4 4 5 5 5 5
4
5 4 3
5 4 3
5 4 2
5 4 2
20
8 2 9 1 1 4 7 3 8 3 9 4 5 1 9 7 1 6 8 8
6
9 8 4
9 7 3
9 7 3
8 6 2
8 5 1
8 4 1
20
1 3 2 2 1 2 3 4 2 4 4 3 1 4 2 1 3 1 4 4
6
4 3 2
4 3 2
4 3 2
4 3 1
4 2 1
4 2 1
20
4 2 2 2 5 2 4 2 2 3 5 2 1 3 1 2 2 5 4 3
5
5 4 2
5 3 2
5 3 2
4 3 2
4 2 1
20
7 6 6 7 2 2 2 2 2 6 1 5 3 4 5 7 1 6 1 4
6
7 6 2
7 5 2
7 5 2
6 4 2
6 4 2
6 3 1
20
15 3 8 5 13 4 8 6 8 7 5 10 14 16 1 3 6 16 9 16
6
16 10 6
16 9 6
16 8 5
15 8 5
14 8 4
13 7 3
2
25 37
0
12
1 1 1 2 2 2 3 3 3 4 4 4
4
4 3 2
4 3 1
4 2 1
3 2 1
12
1 1 1 2 2 2 3 3 3 4 4 5
4
5 3 2
4 3 1
4 2 1
3 2 1
12
4 4 4 3 3 3 2 2 2 1 1 1
4
4 3 2
4 3 1
4 2 1
3 2 1
40
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4
13
4 3 2
4 3 2
4 3 2
4 3 2
4 3 1
4 3 1
4 3 1
4 2 1
4 2 1
4 2 1
3 2 1
3 2 1
3 2 1
12
2 2 2 3 3 3 4 4 4 5 5 5
4
5 4 3
5 4 2
5 3 2
4 3 2
20
1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4
6
4 3 2
4 3 2
4 3 2
4 3 1
4 2 1
3 2 1
12
1 1 1 2 2 2 3 3 3 3 4 4
4
4 3 2
4 3 1
3 2 1
3 2 1
6
1 2 2 3 4 5
2
5 3 2
4 2 1
14
1 1 1 1 1 2 3 4 6 5 5 5 5 5
4
6 5 1
5 4 1
5 3 1
5 2 1
6
1 1 2 3 4 5
2
5 3 1
4 2 1
import heapq

n=int(input())

a={}
for r in map(int,input().split()):
    a[r]=a.get(r,0)-1

b=[]
for r in a:
    b.append((a[r],r))
heapq.heapify(b)

ans,k=[],0
while len(b)>2:
    k+=1
    c=[heapq.heappop(b),heapq.heappop(b),heapq.heappop(b)]
    ans.append([c[0][1],c[1][1],c[2][1]])
    for z in c:
        if z[0]<-1: heapq.heappush(b,[z[0]+1,z[1]])
print(k)
for z in ans:
    z.sort(reverse=True)
    print(*z)

    
