using System; using System.Collections.Generic; using System.Linq; using System.Numerics; namespace yukicoder { public class Program { public static void Main() { var n = int.Parse(Console.ReadLine()); var a = Console.ReadLine().Split().Select(x => long.Parse(x)).ToList(); long s = 0; for(var i = 0; i <= n; i++) { var j = 0; long t = 0; while (j < i) { t += a[j] - a[j + 1]; j += 2; } while (j < 2 * n) { t += a[j + 1] - a[j]; j += 2; } s = Math.Max(t, s); } Console.WriteLine(s); } } }