{ constraints }
const
    MAXN = 1000000;

{ input data }
var
    N, i    : longint;
    E, A, O : array[0..MAXN-1] of longint;

begin
{
    uncomment the following lines if you want to read/write from files
    assign(input,  'input.txt');  reset(input);
    assign(output, 'output.txt'); rewrite(output);
}

    readln(N);
    for i:=0 to N-1 do
        read(E[i]); { evacuation directions }
    readln();
    for i:=0 to N-1 do
        read(A[i]); { arrogance }
    readln();


    { insert your code here }
    for i:=0 to N-1 do O[i] := 42;


    { print the result }
    for i:=0 to N-1 do write(O[i], ' ');
    writeln();
end.
