import java.util.*;
import java.lang.*;
import java.io.*;
class GemsCFW
{
//
static MinerCFW Miner1;
//
static MinerCFW Miner2;
//
static MinerCFW Miner3;
public static void main (String[] args) throws Exception
{
//MinerCFW Miner1, Miner2, Miner3;
String Name, M1, M2, M3;
//File test = new File("test.txt");
Scanner input = new Scanner(System.in);
//System.out.println(input.next());
int r, z, i, t, x, y, b;
int r1, r2, r3, s1, s2, s3, e1, e2, e3, g1, g2, g3;
z = 0;
double Percent1, Percent2, Percent3;
//Scanner input = new Scanner(System.in);
//MinerCFW Miner1 = new MinerCFW();
//MinerCFW Miner2 = new MinerCFW();
//MinerCFW Miner3 = new MinerCFW();
M1 = input.next();
M2 = input.next();
M3 = input.next();
Miner1.setName(M1);
Miner2.setName(M2);
Miner3.setName(M3);
for (int count=1; count <= 3; count++)
{
r = input.nextInt();
z = Miner1.getRubies();
{
i = (z + r);
Miner1.setRubies(i);
r = input.nextInt();
z = Miner2.getRubies();
i = (z + r);
Miner2.setRubies(i);
r = input.nextInt();
z = Miner3.getRubies();
i = (z + r);
Miner3.setRubies(i);
r = input.nextInt();
z = Miner1.getSapphires();
i = (z + r);
Miner1.setSapphires(i);
r = input.nextInt();
z = Miner2.getSapphires();
i = (z + r);
Miner2.setSapphires(i);
r = input.nextInt();
z = Miner3.getSapphires();
i = (z + r);
Miner3.setSapphires(i);
r = input.nextInt();
z = Miner1.getEmeralds();
i = (z + r);
Miner1.setEmeralds(i);
r = input.nextInt();
z = Miner2.getEmeralds();
i = (z + r);
Miner2.setEmeralds(i);
r = input.nextInt();
z = Miner3.getEmeralds();
Miner3.setEmeralds(i);
i = (z + r);
}
r1 = Miner1.getRubies();
r2 = Miner2.getRubies();
r3 = Miner3.getRubies();
s1 = Miner1.getSapphires();
s2 = Miner2.getSapphires();
s3 = Miner3.getSapphires();
e1 = Miner1.getEmeralds();
e2 = Miner2.getEmeralds();
e3 = Miner3.getEmeralds();
g1 = r1+s1+e1;
g2 = r2+s2+e2;
g3 = r3+s3+e3;
Miner1.setTotal(g1);
Miner2.setTotal(g2);
Miner3.setTotal(g3);
x = Miner1.getTotal();
y = Miner2.getTotal();
b = Miner3.getTotal();
t = x+y+z;
Percent1 = x/t;
Percent2 = y/t;
Percent3 = z/t;
System.out.print(r1);
System.out.print(s1);
System.out.print(e1);
System.out.print(x);
System.out.println(Percent1);
System.out.print(r2);
System.out.print(s2);
System.out.print(e2);
System.out.print(y);
System.out.println(Percent2);
System.out.print(r3);
System.out.print(s3);
System.out.print(e3);
System.out.print(z);
System.out.println(Percent3);
System.out.print("The number of gems found in total is: " +t);
}
}
class MinerCFW
{
private String Name, who, what;
private int Rubies, Sapphires, Emeralds, Total, r, s, e;
public MinerCFW () //had static before void
{
// Rubies = 0;
// Sapphires = 0;
// Emeralds = 0;
Name = what;
}
//<<setter methods for ALL the variables
public void setRubies (int Rubies1)
{
Rubies = Rubies1;
}
public void setSapphires (int Sapphires1)
{
Sapphires = Sapphires1;
}
public void setEmeralds (int Emeralds1)
{
Emeralds = Emeralds1;
}
public void setTotal (int Total1)
{
Total = Total1;
}
public void setName(String who)
{
Name = who;
}
//getter for name
public String getName(String Name)
{
return Name;
}
//<<getter methods for all the variables
public int getRubies ()
{
return Rubies;
}
public int getSapphires ()
{
return Sapphires;
}
public int getEmeralds ()
{
return Emeralds;
}
public int getTotal()
{
return Total;
}
}
}