package lyt;
import java.util.*;
public class Lyt1 {
// Scanner input=new Scanner(System.in);
public static void main(String[] args) {
// TODO Auto-generated method stub
int [][]time={
{1,2,3,5,7,3,5},{2,6,3,5,8,1,2},{1,3,7,6,3,9,6},{4,4,4,3,7,8,1},{1,5,4,2,6,3,7},{1,5,3,2,6,8,4},{1,3,4,7,1,1,5},{5,5,5,2,1,1,2}};
int []sum={0,0,0,0,0,0,0,0};
int[]sum0={0,0,0,0,0,0,0,0};
Sum(time,sum,sum0);
java.util.Arrays.sort(sum);
Show(time,sum,sum0);
}
public static void Sum(int [][]time,int []sum,int []sum0)
{
for(int i=0;i<8;i++)
{
for(int j=0;j<7;j++)
sum[i]=sum[i]+time[i][j];
}
for(int i=0;i<8;i++)
{
for(int j=0;j<7;j++)
sum0[i]=sum0[i]+time[i][j];
}
}
public static void Show(int [][]time,int []sum,int []sum0)
{
System.out.printf("%4s%4s%4s%4s%4s%4s%4s\n"," Su","M","T","W","H","F","Sa");
for(int i=0;i<8;i++)
for(int n=0;n<8;n++)
if(sum[7-i]==sum0[n])
{
System.out.print("Employee" + n);
for(int j=0;j<7;j++)
System.out.printf("M",time[n][j]);
System.out.println();
}
}
}