#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

std::vector<int> solve(std::vector<int> a) {
    int n = a.size();
    vector<int> ans;

    map<int, int> mp;
    for (int x : a) mp[x]++;

    for (int it=0; it<2; it++) {
        for (auto [v, c] : mp) {
            for (int i=0; i<c/2; i++)
                ans.push_back(v);
        }
    }

    return ans;
}
