/* The Great Win32 Language Shootout http://dada.perl.it/shootout/ 
   contributed by Isaac Gouy (Nice novice)

To compile:	
   nicec --sourcepath=.. -d=. -a ary3.jar ary3

To run:
   java -jar ary3.jar 7000
*/


// NOTE: the types of n,x,y,i,k,j will be 
//       inferred by the compiler


import ackermann; // reuse toSingleInt

void main(String[] args){
   let n = toSingleInt(args);

   let x = new int[n];
   for(var i=0; i=0; j--) y[j] += x[j];

   print(y[0]); print(" "); println(y[n-1]);
}