#include<iostream>
#include<cassert>
#include<algorithm>
#include<cmath>
#include<complex>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define pb         push_back
#define mp         make_pair

typedef complex<double> P;

const double eps = 1e-12;
const double pi  = acos(-1);

double cross(P a,P b){
  return a.real()*b.imag()-a.imag()*b.real();
}

double dot(P a,P b){
  return a.real()*b.real()+a.imag()*b.imag();
}

pair<P,P> CC_intersection(P a,P b,double r1,double r2){
  double l,m,n;
  double d = abs(a-b);
  double x,y;
  double p,q;
  l=(d*d-r2*r2+r1*r1)/(2*d);
  
  x=a.real()+(b.real()-a.real())*l/d;
  y=a.imag()+(b.imag()-a.imag())*l/d;
  
  n=sqrt(r1*r1-l*l);
  
  p=(b.imag()-a.imag())/d*n;
  q=(b.real()-a.real())/d*n;
  
  return mp(P(x+p,y-q),P(x-p,y+q));
}

const int CUT = 10000;
void compute_arg(P cur,P next,P circle,vector<P> &gon){
  double argA=arg(cur -circle);
  double argB=arg(next-circle);
  if (max(argA,argB)-min(argA,argB)>pi){
    if (argA<0)argA+=2*pi;
    else       argB+=2*pi;
  }
  double dif=(argB-argA)/(double)CUT;
  double cosx=cos(dif),sinx=sin(dif);
  P now=cur-circle;
  rep(i,CUT){
    double tx=cosx*now.real()-sinx*now.imag();
    double ty=sinx*now.real()+cosx*now.imag();

    now.real()=tx;
    now.imag()=ty;
    
    gon.pb(circle+now);
  }
}

P compute_centeroid(vector<P> &in,int n){
  double cx=0,cy=0;//center
  double a=0;//area of polygon
  rep(i,n){
    double cr=cross(in[i],in[(i+1)%n]);
    a+=cr;
    cx+=(in[i].real()+in[(i+1)%n].real())*cr;
    cy+=(in[i].imag()+in[(i+1)%n].imag())*cr;
  }
  a/=2.0;
  //  if (a < 0)a*=-1;//may be don't need
  cx/=(6.0*a);
  cy/=(6.0*a);
  return P(cx,cy);
}

double distance_ls_p(P a,P b,P c){
  if (dot(b-a,c-a)<eps)return abs(c-a);
  if (dot(a-b,c-b)<eps)return abs(c-b);
  return abs(cross(b-a,c-a))/abs(b-a);
}

void solve(double sx,double sy){
  vector<P> gon;
  gon.pb(P(sx,sy));
  string order;
  P cur(sx,sy);
  while(true){
    cin>>order;
    if (order == "line"){
      P next;
      cin>>next.real()>>next.imag();
      gon.pb(next);
      cur=next;
    }else if (order == "arc"){
      P next;
      double r;
      cin>>next.real()>>next.imag()>>r;
      pair<P,P> tmp=CC_intersection(cur,next,fabs(r),fabs(r));
      if (r < 0){
	if (cross(next-cur,tmp.first-cur)>0)compute_arg(cur,next,tmp.first ,gon);
	else                                compute_arg(cur,next,tmp.second,gon);
      }else if (r > 0){
	if (cross(next-cur,tmp.first-cur)<0)compute_arg(cur,next,tmp.first ,gon);
	else                                compute_arg(cur,next,tmp.second,gon);
      }
      cur=next;
    }else if (order == "close"){
      if (abs(gon[0]-gon[gon.size()-1])<eps)gon.erase(gon.begin()+gon.size()-1);
      //else gon.pb(gon[0]);
      break;
    }
  }

  P ans=compute_centeroid(gon,gon.size());


  
  int index = -1;
  double dist = 1e100;
  int n=gon.size();
  rep(i,gon.size()){
    double tmp = distance_ls_p(gon[i],gon[(i+1)%n],ans);
    if (tmp < dist){
      index=i;
      dist=tmp;
    }
  }

  char out;
  if (cross(gon[(index+1)%n]-gon[index],ans-gon[index])<-eps)out='-';
  else out='+';

  printf("%.4lf %.4lf %c\n",ans.real(),ans.imag(),out);
}

main(){
  string in;
  double sx,sy;
  while(cin>>in && in != "end"){
    cin>>sx>>sy;
    solve(sx,sy);
  }
}

Measured memory_bytes: 3940