using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, x, y) = (c[0], c[1], c[2]); var a = NList; var xcum = new long[n + 1]; for (var i = 0; i < n; ++i) xcum[i + 1] = xcum[i] + x - a[i]; var ycum = new long[n + 1]; for (var i = 0; i < n; ++i) ycum[i + 1] = ycum[i] + y - a[i]; var left = new long[n]; { var min = xcum[0]; for (var i = 0; i < n; ++i) { left[i] = xcum[i + 1] - min; min = Math.Min(min, xcum[i + 1]); if (i > 0) left[i] = Math.Max(left[i - 1], left[i]); } } var right = new long[n]; { var max = ycum[n]; for (var i = n - 1; i >= 0; --i) { right[i] = max - ycum[i]; max = Math.Max(max, ycum[i]); if (i + 1 < n) right[i] = Math.Max(right[i], right[i + 1]); } } var sum = 0L; foreach (var ai in a) sum += ai; var ans = new long[n - 2]; for (var i = 1; i + 1 < n; ++i) ans[i - 1] = sum + left[i - 1] + right[i + 1]; WriteLine(string.Join("\n", ans)); } }