#include using namespace std; int main() { auto get_ints = []() { vector res; string buf; getline(cin, buf); stringstream ss(buf); for (string s; ss >> s; ) { res.push_back(stoi(s)); } return res; }; int N = get_ints()[0]; assert(N == 3); vector r1 = get_ints(); if (r1.size() == 3) { cout << "\"assert\"" << endl; } else { r1.push_back(get_ints()[0]); r1.push_back(get_ints()[0]); vector sums; for (int i = 0; i < N; ++i) { for (int j = i + 1; j < N; ++j) { sums.push_back(r1[i] + r1[j]); } } sort(sums.begin(), sums.end(), [](int x, int y) { return x > y; }); cout << sums[1] << endl; } return 0; }