import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[Math.max(3, n + 1)]; for (int i = 0; i <= n; i++) { arr[i] = sc.nextInt(); } for (int i = n; i >= 3; i--) { arr[i - 2] += arr[i]; } if (arr[2] == 0) { if (arr[1] == 0) { System.out.println(0); System.out.println(arr[0]); } else { System.out.println(1); System.out.println(arr[0] + " " + arr[1]); } } else { System.out.println(2); System.out.println(arr[0] + " " + arr[1] + " " + arr[2]); } } }