#include <stdio.h>

#define for(what) if (0) ; else for(what)
#define EPS 1e-9

int n;
int p[100][2][2], z[100];
bool f[2];
double _sx[2], _px[2], _pz[2];

double side(double x1, double y1, double x2, double y2, double x3, double y3)
{
  double s = x1*y2-y1*x2+x2*y3-y2*x3+x3*y1-y3*x1;
  if (s>EPS)
    return 1;
  if (s<-EPS)
    return -1;
  return 0;
}

bool check(double sx, double px, double pz, int a, int b)
{
  return (side(sx,0,px,pz,p[a][0][b],z[a])*side(sx,0,px,pz,p[a][1][b],z[a])!=1);
}

void relax(double sx, double px, double pz, int a)
{
  if (f[a])
    return;
  for (int i=0;i<n;i++)
    if (!check(sx,px,pz,i,a))
      return;
  f[a] = true;
  _sx[a] = sx;
  _px[a] = px;
  _pz[a] = pz;
}

int main(void)
{
  freopen("gunman.in",  "rt", stdin);
  freopen("gunman.out", "wt", stdout);

  scanf("%d", &n);
  for (int i=0;i<n;i++)
    scanf("%d%d%d%d%d",&(p[i][0][0]),&(p[i][0][1]),&(p[i][1][0]),&(p[i][1][1]),&(z[i]));

  for (int i=0;i<n;i++)
    for (int j=0;j<i;j++)
      for (int ii=0;ii<2;ii++)
        for (int jj=0;jj<2;jj++)
        {
          double sx = p[j][jj][0]*z[i]-p[i][ii][0]*z[j];
          sx /= (z[i]-z[j]);
          relax(sx,p[i][ii][0],z[i],0);
        }

  for (int i=0;i<n;i++)
    for (int ii=0;ii<2;ii++)
      for (int jj=0;jj<2;jj++)
        relax(0,p[i][ii][jj],z[i],jj);

  if (!f[0]||!f[1])
    printf("UNSOLVABLE\n");
  else
  {
    double sx = _sx[0];
    double sy = _sx[1];
    double x = (_px[0]-_sx[0])/_pz[0];
    double y = (_px[1]-_sx[1])/_pz[1];
    printf("SOLUTION\n");
    printf("%.10lf\n",sx);
    for (int i=0;i<n;i++)
      printf("%.10lf %.10lf %.10lf\n",sx+z[i]*x,sy+z[i]*y,(double)z[i]);
  }

  return 0;
}