Language: C++

using namespace std;

int main()
{
/*	int a, b, c, d, e;
	std::cin >> a >> b >> c >> d >> e;
	*/

	int X, Y, Z, K;
	std::cin >> X >> Y >> Z >> K;

	vector<long long int> A;
	vector<long long int> B;
	vector<long long int> C;
	vector<long long int> sum;

	long long int tmp;
	for (int i = 0; i < X; i++) {
		std::cin >> tmp;
		A.emplace_back(tmp);
	}
	for (int i = 0; i < Y; i++) {
		std::cin >> tmp;
		B.emplace_back(tmp);
	}
	for (int i = 0; i < Z; i++) {
		std::cin >> tmp;
		C.emplace_back(tmp);
	}

	for (int A_i = 0; A_i < X; A_i++) {
		for (int B_i = 0; B_i < Y; B_i++) {
			for (int C_i = 0; C_i < Z; C_i++) {
//				sum.emplace_back(A[A_i] + B[B_i] + C[C_i]);
				sum.emplace(sum.begin(), A[A_i] + B[B_i] + C[C_i]);
			}
		}
	}

//	sort(sum.begin(), sum.end());
	sort(sum.begin(), sum.end(), greater<long long int>());

	for (int i = 0; i < K; i++) {
		std::cout << sum[i] << endl;
	}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'cin' is not a member of 'std'
   10 |         std::cin >> X >> Y >> Z >> K;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:12:9: error: 'vector' was not declared in this scope
   12 |         vector<long long int> A;
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:12:16: error: expected primary-expression before 'long'
   12 |         vector<long long int> A;
      |                ^~~~
a.cc:13:16: error: expected primary-expression before 'long'
   13 |         vector<long long int> B;
      |                ^~~~
a.cc:14:16: error: expected primary-expression before 'long'
   14 |         vector<long long int> C;
      |                ^~~~
a.cc:15:16: error: expected primary-expression before 'long'
   15 |         vector<long long int> sum;
      |                ^~~~
a.cc:19:22: error: 'cin' is not a member of 'std'
   19 |                 std::cin >> tmp;
      |                      ^~~
a.cc:19:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:17: error: 'A' was not declared in this scope
   20 |                 A.emplace_back(tmp);
      |                 ^
a.cc:23:22: error: 'cin' is not a member of 'std'
   23 |                 std::cin >> tmp;
      |                      ^~~
a.cc:23:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:17: error: 'B' was not declared in this scope
   24 |                 B.emplace_back(tmp);
      |                 ^
a.cc:27:22: error: 'cin' is not a member of 'std'
   27 |                 std::cin >> tmp;
      |                      ^~~
a.cc:27:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:17: error: 'C' was not declared in this scope
   28 |                 C.emplace_back(tmp);
      |                 ^
a.cc:35:33: error: 'sum' was not declared in this scope
   35 |                                 sum.emplace(sum.begin(), A[A_i] + B[B_i] + C[C_i]);
      |                                 ^~~
a.cc:35:58: error: 'A' was not declared in this scope
   35 |                                 sum.emplace(sum.begin(), A[A_i] + B[B_i] + C[C_i]);
      |                                                          ^
a.cc:35:67: error: 'B' was not declared in this scope
   35 |                                 sum.emplace(sum.begin(), A[A_i] + B[B_i] + C[C_i]);
      |                                                                   ^
a.cc:35:76: error: 'C' was not declared in this scope
   35 |                                 sum.emplace(sum.begin(), A[A_i] + B[B_i] + C[C_i]);
      |                                                                            ^
a.cc:41:14: error: 'sum' was not declared in this scope
   41 |         sort(sum.begin(), sum.end(), greater<long long int>());
      |              ^~~
a.cc:41:38: error: 'greater' was not declared in this scope
   41 |         sort(sum.begin(), sum.end(), greater<long long int>());
      |                                      ^~~~~~~
a.cc:41:46: error: expected primary-expression before 'long'
   41 |         sort(sum.begin(), sum.end(), greater<long long int>());
      |                                              ^~~~
a.cc:41:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   41 |         sort(sum.begin(), sum.end(), greater<long long int>());
      |         ^~~~
      |         short
a.cc:44:22: error: 'cout' is not a member of 'std'
   44 |                 std::cout << sum[i] << endl;
      |                      ^~~~
a.cc:44:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:40: error: 'endl' was not declared in this scope
   44 |                 std::cout << sum[i] << endl;
      |                                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;