import java.util.ArrayList; import java.util.Scanner; public class No112 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); s.nextLine(); ArrayList al = new ArrayList(); for(int i = 0;i < n;i++){ al.add(s.nextInt()); } s.close(); if(al.size() == 1){ int ans = (int)al.get(0) / 2 - n; System.out.println(ans + " " + ans); }else{ int a = ((int)al.get(0) + (int)al.get(1)) / 2 + 3; int k = a / 2 - n; System.out.println(n - k + " " + k); } } }