local mmi, mma = math.min, math.max local n = io.read("*n") local a = {} for i = 1, n do a[i] = io.read("*n") end local odd, even = -a[1], -1000000007 * 200010 for i = 2, n do local ai = a[i] odd, even = mma(odd, even - ai, -ai), mma(even, odd + ai) end local ans = mma(odd, even) ans = tostring(1LL * ans):gsub("LL", "") print(ans)