{ $DEFINE VIZI}
{$apptype console}
{$O-,Q+,R+}
uses
    testlib, sysutils, math
    {$IFDEF VIZI}, graph, types, graphics{$ENDIF VIZI};
const
    max_n = 30;
    max_a = 100 * pi;
    eps = 1e-5;

function norm(a: extended): extended;
begin
    while a > pi + eps do begin
        a := a - 2 * pi;
    end;
    while a < -(pi + eps) do begin
        a := a + 2 * pi;
    end;
    norm := a;
end;

var
    i, j, k, n: longint;
    x, y: array [1..max_n] of longint;
    angle, a1, a2: array [1..max_n] of extended;
    a, b, c: array [1..2 * max_n] of extended;
    da: extended;

{$IFDEF VIZI}
procedure drawPoints(px, py: extended);
const
    scale = 0.5;
var
    i: longint;
    minx, maxx, miny, maxy: extended;
    a1, a2: extended;
    points: array [1..max_n, 1..5] of tPoint;     
    sx, sy, cx, cy: extended;
    sizex, sizey: integer;
    ix, iy: longint;
begin
    minx := px - 1;
    maxx := px + 1;
    miny := py - 1;
    maxy := py + 1;

    for i := 1 to n do begin
        if (minx > x[i]) then minx := x[i];
        if (maxx < x[i]) then maxx := x[i];
        if (miny > y[i]) then miny := y[i];
        if (maxy < y[i]) then maxy := y[i];
    end;

    sizex := form.clientwidth;
    sizey := form.clientheight;

    sx := sizex / (maxx - minx) * scale;
    sy := sizey / (maxy - miny) * scale;
    if sx > sy then begin
        sx := sy;
    end else begin
        sy := sx;
    end;
    cx := (maxx + minx) / 2;
    cy := (maxy + miny) / 2;

    clear;

    for i := 1 to n do begin
        points[i][1].x := round(sizex / 2 + sx * (x[i] - cx));
        points[i][1].y := round(sizey / 2 - sy * (y[i] - cy));
        a1 := angle[i] + pi / n;
        a2 := angle[i] - pi / n;
        points[i][2].x := round(points[i][1].x + 5000 * cos(a1));
        points[i][2].y := round(points[i][1].y - 5000 * sin(a1));
        points[i][3].x := round(points[i][1].x + 5000 * cos((a1 + a2) / 2));
        points[i][3].y := round(points[i][1].y - 5000 * sin((a1 + a2) / 2));
        points[i][4].x := round(points[i][1].x + 5000 * cos(a2));
        points[i][4].y := round(points[i][1].y - 5000 * sin(a2));
        points[i][5].x := points[i][1].x;
        points[i][5].y := points[i][1].y;
    end;

    canvas.pen.width := 1;
    canvas.brush.color := $3f3f3f;
    for i := 1 to n do begin
        canvas.polygon(points[i]);
    end;
    canvas.pen.color := 0;
    for i := 1 to n do begin
        canvas.polyline(points[i]);
    end;

    canvas.pen.color := $ffffff;    
    canvas.brush.color := $ffffff;
    for i := 1 to n do begin
        canvas.ellipse(points[i][1].x - 5, points[i][1].y - 5, points[i][1].x + 5, points[i][1].y + 5);
    end;
    canvas.pen.color := $0000ff;    
    canvas.brush.color := $0000ff;
    ix := round(sizex / 2 + sx * (px - cx));
    iy := round(sizey / 2 - sy * (py - cy));
    canvas.ellipse(ix - 7, iy - 7, ix + 7, iy + 7);
end;
{$ENDIF}

function between(a, x, b: extended): boolean;
begin
    while x < a + eps do begin
        x := x + 2 * pi;
    end;
    while x > b - eps do begin
        x := x - 2 * pi;
    end;
    between := x > a + eps;
end;

procedure check(px, py: extended);
var
    pa: extended;
    f: boolean;
    i: longint;
    c: longint;
begin
    c := 0;
    f := false;
    for i := 1 to n do begin
        if (abs(px - x[i]) > eps) or (abs(py - y[i]) > eps) then begin
            pa := norm(arctan2(py - y[i], px - x[i]));
            if between(a1[i], pa, a2[i]) then begin
                f := true;
            end;
            if (abs(norm(a1[i] - pa)) < eps) or (abs(norm(a2[i] - pa)) < eps) then begin
                inc(c);
            end; 
        end;
    end;
    if not f then begin
        if c < 2 then begin
            {$ifdef VIZI}
            initGraph;
            drawPoints(px, py);
            waitForKey;
            {$endif VIZI}
            quit(_wa, format('(%0.7f, %0.7f) uncovered', [px, py]));
        end;
    end;
end;

var
    d: extended;
    ox, oy: extended;
    cr: longint;
    r: array [0..max_n * 2] of extended;
    q, az: extended;
    //s: string;
begin
{ // RE: IMPOSSIBLE answer was removed from output spec

    s := trim(ouf.readString());
    if s = 'IMPOSSIBLE' then begin
        quit(_WA, 'Solution not found (IMPOSSIBLE)');
    end;
    ouf.reset();
}
    n := inf.readLongint();

    da := pi / n;
    for i := 1 to n do begin
        x[i] := inf.readLongint();
        y[i] := inf.readLongint();
        az := ouf.readReal();
        if abs(az) > max_a + eps then begin
            quit(_wa, format('Angle %d too large: %0.2f', [i, az]));
        end;
        angle[i] := norm(az);
        a1[i] := angle[i] - da;
        a2[i] := angle[i] + da;
    end;

    for i := 1 to n do begin
        a[2 * i - 1] := sin(angle[i] + da);
        b[2 * i - 1] := -cos(angle[i] + da);
        c[2 * i - 1] := a[2 * i - 1] * x[i] + b[2 * i - 1] * y[i];

        a[2 * i - 0] := sin(angle[i] - da);
        b[2 * i - 0] := -cos(angle[i] - da);
        c[2 * i - 0] := a[2 * i - 0] * x[i] + b[2 * i - 0] * y[i];
    end;

    for i := 1 to 2 * n do begin
        ox := c[i] * a[i];
        oy := c[i] * b[i];

        cr := 0;
        for j := 1 to 2 * n do begin
            d := a[i] * b[j] - a[j] * b[i];
            if abs(d) > eps then begin
                inc(cr);
                r[cr] := (c[j] - c[i] * (a[i] * a[j] + b[i] * b[j])) / d;
            end;
        end;
        for j := 1 to cr do begin
            for k := j + 1 to cr do begin
                if r[j] > r[k] then begin
                    q := r[j]; r[j] := r[k]; r[k] := q;
                end;
            end;
        end;
        r[0] := r[1] - 1;
        r[cr + 1] := r[cr] + 1;
        for j := 0 to cr do begin
            check(
                ox - b[i] * (r[j + 1] + r[j]) / 2, 
                oy + a[i] * (r[j + 1] + r[j]) / 2
            );
        end;
    end;
    {$ifdef VIZI}
            initGraph;
            drawPoints(0, 0);
            waitForKey;
    {$endif VIZI}
    quit(_ok, format('N=%d', [n]));
end.