import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int D = scanner.nextInt(); int[] a = new int[D + 1]; for (int i = 0; i < D + 1; i++) { a[i] = scanner.nextInt(); } for (int i = D; i >= 3; i--) { a[i - 2] += a[i]; a[i] = 0; } int ans = 0; if (D > 2 && a[2] != 0) { ans = 2; } else if (D > 1 && a[1] != 0) { ans = 1; } System.out.println(ans); for (int i = 0; i <= ans; i++) { System.out.print(a[i] + " "); } System.out.println(); } }