#include <fstream>

using namespace std;

int main()
{
	ifstream input;
	ofstream output;
	long long n, m;
	bool exist = false;

	input.open("TONGBANGM.inp");
	output.open("TONGBANGM.out");

	input >> n >> m;
	int a[n];
	
	for (int i = 0; i < n; i++)
	{
		input >> a[i];
	}

	for (int i = 0; i < n - 2; i++)
	{
		for (int j = i + 1; j < n - 1; j++)
		{
			for (int k = j + 1; k < n; k++)
			{
				if (a[i] + a[j] + a[k] == m)
				{
					exist == true;
					output << a[i] << ' ' << a[j] << ' ' << a[k] << '\n';
				}
			}
		}
	}
	if (exist == false)
	{
		output << 0;
	}

	input.close();
	output.close();
	return 0;
}