#include <bits/stdc++.h>
#include "partition.h"
using namespace std;
int curr_ans;
int ans;
vector<int>anss;
int i=0;
int s;
vector<int> solve(vector<int>a)
{
    for(int j: a)
    {
        s+=j;
    }
    while(next_permutation(a.begin(), a.end()))
    {
        while(curr_ans<=s/2)
        {
            curr_ans+=a[i];
            i++;
        }
        if(curr_ans>ans)
        {
            ans=curr_ans;
            anss=a;
        }
        curr_ans=0;
        i=0;
    }
    return anss;
}
