import java.util.Scanner; public class Main_yukicoder40 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int d = sc.nextInt(); int[] a = new int[d + 1]; for (int i = 0; i <= d; i++) { a[i] = sc.nextInt(); } for (int i = d; i >= 3; i--) { a[i - 2] -= -a[i]; a[i] = 0; } if (a[2] != 0) { System.out.println("2"); System.out.printf("%d %d %d\n", a[0], a[1], a[2]); } else if (a[1] != 0) { System.out.println("1"); System.out.printf("%d %d\n", a[0], a[1]); } else { System.out.println("0"); System.out.printf("%d\n", a[0]); } sc.close(); } }