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

void main() {
    int n;
    bool st, uni;
    scan(n);

    st = 1, uni = 1;

    foreach (i ; 1 .. n) {
        int ai, bi;
        scan(ai, bi);

        if (ai != i || bi != i + 1) st = 0;
        if (ai != 1 || bi != i + 1) uni = 0;
    }

    auto s = readln.split.to!(long[]);
    auto d = new long[](n + 1);


    if (st) {

        foreach (i ; 1 .. n) {
            if (((n & 1) == 0) && (i == n / 2)) continue;
            d[i] = (s[i - 1] - s[i]) / (n - 2*i);
        }

        if ((n & 1) == 0) {
            long w;

            foreach (i ; 1 .. n / 2) {
                w += d[i] * i + d[n - i] * i;
            }

            d[n / 2] = (s[n / 2] - w) / (n / 2);
        }
    }

    foreach (i ; 1 .. n) {
        writeln(d[i]);
    }
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}