#include <cstdio>
#include <iostream>
using namespace std;
int d, a1[4];
int d1(int *a1)
{
    int sum = a1[0];
    for (int i = 1; i < 4; i++)
    {
        if (sum % a1[i] != 0)
            return i;
    }
    return 0;
}
int getS(int *a1)
{
    int sum = 0, ss = 1;
    while (d1(a1) != 0)
    {
        int index = d1(a1);
        a1[0] = a1[0] * a1[index];
        ss = a1[index];
    }
    for (int i = 1; i < 4; i++)
    {
        sum += (a1[0] / a1[i]);
    }
    return sum + ss;
}
int main()
{
    for (int sum = 20; sum >= 1; sum--)
    {
        for (int a = 1; a <= 20; a++)
        {
            for (int b = 1; b <= 20; b++)
            {
                for (int c = 1; c <= 20; c++)
                {
                    a1[0] = sum, a1[1] = a, a1[2] = b, a1[3] = c;
                    if (getS(a1) == a1[0] && a > b && b > c && sum > a)
                    {
                        printf("%d, %d, %d, %d, 0\n", sum, a, b, c);
                    }
                }
            }
        }
    }
    return 0;
}