/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		int[] year ={2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026};
		int[] at_bat ={3,286,142,302,527,569,554,557,394,527,532,533,477,333,305,409,372,387,239,157,124,23,13};
		int[] hits ={1,85,38,84,167,152,172,171,114,147,153,143,133,84,78,103,101,97,63,34,28,2,2};
		int[] games ={1,84,63,112,138,140,144,144,103,144,144,142,135,116,114,123,111,117,89,77,60,11,11};
		double[] anda = new double[games.length];
			for(int i=0;i<games.length;i++){		//ソート開始
				for(int j = i+1;j<games.length;j++){		//i+1～最後までを比較
					if(games[i]<games[j]){
					int a = year[i];
					year[i] = year[j];
					year[j] = a;
					int b = at_bat[i];
					at_bat[i] = at_bat[j];
					at_bat[j] = b;
					int c = hits[i];
					hits[i] = hits[j];
					hits[j] = c;
					int d = games[i];
					games[i] =games[j];
					games[j] = d;		//比較したとき大きいとき値を代入
					}
				}
			}
			for(int i=0;i<hits.length;i++){		//打率の計算
				anda[i] = (double) hits[i]/at_bat[i];
			}
			for(int i=0;i<year.length;i++){
			System.out.printf(year[i]+ " ");
			}
			System.out.printf("\n");
			for(int i=0;i<at_bat.length;i++){
			System.out.printf(at_bat[i]+ " ");
			}
			System.out.printf("\n");
			for(int i=0;i<hits.length;i++){
			System.out.printf(hits[i]+ " ");
			}
			System.out.printf("\n");
			for(int i=0;i<games.length;i++){
			System.out.printf(games[i]+ " ");
			}
			System.out.printf("\n");
			for(int i=0;i<anda.length;i++){
			System.out.printf(anda[i]+ " ");
			}
			System.out.printf("\n");
			int allg=0;
			int allab=0;
			int allh=0;
			double allad=0;
			for(int i=0;i<games.length;i++){		//初期値0に配列の値を追加していく
				allg = allg+games[i];
				allab = allab+at_bat[i];
				allh = allh+hits[i];
				allad = (double) allh/allab;
			}
			System.out.printf("%d\n",allg);
			System.out.printf("%d\n",allab);
			System.out.printf("%d\n",allh);
			System.out.printf("%f\n",allad);
	}

}