#include <stdio.h>
#include <string>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>

using namespace std;

int strpos(char s[], char p[]);

vector<string> split(string &s, const char &c)
{
    string buffer{""};

    vector<string> resultado;

    for (char caractere : s)
    {
        if (caractere != c)
        {
            buffer += caractere;
        }
        else
        {
            resultado.push_back(buffer);
            buffer = "";
        }
    }
    if (buffer != "")
    {
        resultado.push_back(buffer);
        buffer = "";
    }

    return resultado;
}

int main(int argc, char **argv)
{

    int a = 0;
    string linha;
    char ing[11][17] = {"Milho verde", "Oleo vegetal", "Acucar", "Fuba", "Ovos", "Farinha de trigo", "Coco ralado", "Fermento em po", "Leite de coco", "Chocolate em po", "Leite"};
    int qr[11][4] = {
        {200, 0, 0, 0},
        {200, 120, 240, 0},
        {250, 360, 160, 0},
        {200, 0, 0, 0},
        {4, 4, 2, 0},
        {15, 240, 240, 0},
        {15, 100, 0, 0},
        {5, 10, 15, 0},
        {0, 200, 0, 0},
        {0, 0, 90, 0},
        {0, 0, 240, 0}};
    char med[11][3] = {"Kg", "L", "Kg", "Kg", "", "Kg", "Kg", "Kg", "L", "Kg", "L"};

    while (true)
    {
        getline(cin, linha);

        if (linha == "0")
        {
            break;
        }

        vector<string> temp = split(linha, ' ');

        int n = atoi(temp[0].c_str());

        for (int x = 0; x < n; x++)
        {
            getline(cin, linha);
            vector<string> temp = split(linha, ' ');
            int milho = atoi(temp[0].c_str());
            int coco = atoi(temp[1].c_str());
            int choco = atoi(temp[2].c_str());

            for (int i = 0; i < 11; i++)
            {
                qr[i][3] = qr[i][3] + qr[i][0] * milho;
                qr[i][3] = qr[i][3] + qr[i][1] * coco;
                qr[i][3] = qr[i][3] + qr[i][2] * choco;
            }
            // }
        }
    }
    for (int x = 0; x < 11; x++)
    {
        if (!strcmp(med[x], ""))
        {
            cout << ing[x] << " " << qr[x][3] << med[x] << endl;
        }
        else
        {
            cout << ing[x] << " " << ((int)qr[x][3]) / 1000 << med[x] << endl;
        }
    }

    return 0;
}
