import java.io.*;

public class atm
{
	static int util=48;
	static int numero=3;
	static int cuenta=0;
	static int cual=0;
	static int total=0;		
	static int intvid=0, intvoz=0, intdat=0;
	public static void main(String arg[]) throws IOException
	{
		BufferedReader entrada = new BufferedReader (new InputStreamReader(System.in));;
		String mostrartipo="";
			System.out.println(" ¿Cuantos Servicios de van a prestar?");
			numero = Integer.parseInt(entrada.readLine() );

		int celdas[]=new int[numero];
		String tipos[]=new String[numero];
		int tamanos[]=new int[numero]; 
		int inttipo[]=new int[numero];
		System.out.println("Qué tipo de servicio es?\nvideo, voz ó datos?");
		for(int a=0;a<numero;a++)
		{
			System.out.print((a+1)+".- ");
			tipos[a] = entrada.readLine();
		}
		
		for(int a=0;a<numero;a++)
		{
			if(tipos[a].equalsIgnoreCase("video"))
			{
				inttipo[a]=3;
				tipos[a]="video";
				tamanos[a]=video();
			}
			if(tipos[a].equalsIgnoreCase("voz"))
			{
				inttipo[a]=2;
				tipos[a]="voz";
				tamanos[a]=voz();
			}
			if(tipos[a].equalsIgnoreCase("datos"))
			{
				inttipo[a]=1;
				tipos[a]="datos";
				tamanos[a]=datos();
			}
				
		}
		double redondeo;
		for(int a=0;a<numero;a++)
		{
			if(inttipo[a]==3)
			{
				intvid+=(int) Math.ceil(tamanos[a]/util);
			}
			if(inttipo[a]==2)
			{
				intvoz+=(int) Math.ceil(tamanos[a]/util);
			}
			if(inttipo[a]==1)
			{
				intdat+=(int) Math.ceil(tamanos[a]/util);
			}
		}
		System.out.println(""+intvid+""+intvoz+""+intdat);
		for(int a=0;a<numero;a++)
		{
			redondeo=tamanos[a]/util;
			celdas[a]=((int) Math.ceil( redondeo ));
			System.out.println((a+1)+".- El servicio se divide en "+tipos[a]+": "+celdas[a]+" celdas");
		}
		for(int a=0;a<tipos.length;a++)
		total+=celdas[a];	
			int vi=0,vo=0,da=0;
		for(int a=1;a<=total; a++)
		{
			if(vi>=3 && vo>=2 && da>=1)
			{
				vi=0;vo=0;da=0;
			}
			if(intvid<=0)
			{
				vi=3;
			}
			if(intvoz<=0)
			{
				vi=2;
			}
			if(intdat<=0)
			{
				vi=1;
			}
						
			if(vi<3 && intvid>0)
			{
				intvid--;
				vi++;
				mostrartipo="Video";
				cual=1;
			}
			else
			if (vo<2 && intvoz>0)
			{
				intvoz--;
				vo++;
				mostrartipo="Voz";
				cual=2;
			}
			else
			if(da<1 && intdat>0)
			{
				intdat--;
				da++;
				mostrartipo="Datos";
				cual=3;
			}
				switch(cual)
				{
					case 1:
						System.out.println("Enviando 48 Bytes de: " + mostrartipo); 
					break;
					case 2:
						System.out.println("Enviando 48 Bytes de: " +mostrartipo); 
					break;
					case 3:
						System.out.println("Enviando 48 Bytes de: " +mostrartipo); 
					break;
				}
		}

	}

	public static int voz()throws IOException
	{
			BufferedReader entrada = new BufferedReader (new InputStreamReader(System.in));;
		int tamano;
		System.out.print("Tamaño del paquete de voz en KB: ");
		tamano = 1024*Integer.parseInt(entrada.readLine());
		return tamano;
	}
	public static int video()throws IOException
	{
		BufferedReader entrada = new BufferedReader (new InputStreamReader(System.in));;
		int tamano;
		System.out.print("Tamaño del paquete de video en KB: ");
		tamano = 1024*Integer.parseInt(entrada.readLine());
		return tamano;
	}
	public static int datos()throws IOException
	{
		BufferedReader entrada = new BufferedReader (new InputStreamReader(System.in));;
		int tamano;
		System.out.print("Tamaño del paquete de datos en KB: ");
		tamano = 1024*Integer.parseInt(entrada.readLine());
		return tamano;
	}
	//Todo este pequeño script por Arturo Enrique Ojeda Dominguez
}

