import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;


void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!int).array;
    auto B = A.dup.sort().array;
    
    foreach (a; A) {
        int max_a = a == B.back ? B[$-2] : B[$-1];
        int min_a = a == B.front ? B[1] : B[0];
        int ans = 0;
        if (max_a >= 0) ans += max_a * 2;
        if (min_a <= 0) ans += abs(min_a) * 2;
        ans.writeln;
    }
}
