program capital;

const
    dx: array [1..4] of longint = (1, 0, -1, 0);
    dy: array [1..4] of longint = (0, -1, 0, 1);

    maxn = 100;

var
    x, y, x2, y2: array [1..maxn] of longint;
    xc, yc, xp, yp: longint;
    best: longint;
    flag: boolean;
    i, j, k, n, t, d: longint;

begin
{    assign(input, 'capital.in');
    reset(input);
    assign(output, 'capital.out');
    rewrite(output);}

    read(n);

    for i := 1 to n do
    begin
        read(x[i], y[i]);
        x2[i] := x[i];
        y2[i] := y[i];
    end;

    for i := 1 to n do
        for j := i + 1 to n do
        begin
            if x2[i] > x2[j] then
            begin
                t := x2[i]; x2[i] := x2[j]; x2[j] := t;
            end;
            if y2[i] > y2[j] then
            begin
                t := y2[i]; y2[i] := y2[j]; y2[j] := t;
            end;
        end;

    xc := x2[(n + 1) div 2];
    yc := y2[(n + 1) div 2];

    flag := true;
    for i := 1 to n do
    begin
        if (x[i] = xc) and (y[i] = yc) then
            flag := false;
    end;

    if not flag then
    begin
        best := maxlongint;
        for i := 1 to n do
        begin
            for k := 1 to 4 do
            begin
                xp := x[i] + dx[k];
                yp := y[i] + dy[k];

                flag := true;
                for j := 1 to n do
                begin
                    if (x[j] = xp) and (y[j] = yp) then
                        flag := false;
                end;
                if not flag then continue;

                d := 0;
                for j := 1 to n do
                begin
                    d := d + abs(xp - x[j]) + abs(yp - y[j]);
                end;
                if d < best then
                begin
                    best := d;
                    xc := xp;
                    yc := yp;
                end;
            end;
        end;
    end;

    writeln(xc, ' ', yc);

    close(input);
    close(output);
end.
