int main()
{
int x, y, z, m, a, b, c, p, q;
int n = 0;
for (x = 0; x <= 60; ++x)
for(y = 0; y < 200/3; ++y)
for(z = 0; z <= 45; ++z)
{
m = 25 * x + 20 * y + 60 * z;
p = x + 3 * y + 2 * z;
q = 3 * x + y + 4 * z;
if (p <= 200 && q <= 180 && m > n)
{
a = x;
b = y;
c = z;
n = m;
}
}
cout << a << " " << b << " " << c << " " << n << endl;
return 0;
}