Problem: Problem Statement

One day, you found an old scroll with strange texts on it.

You revealed that the text was actually an expression denoting the position of treasure. The expression consists of following three operations:

* From two points, yield a line on which the points lie.
* From a point and a line, yield a point that is symmetric to the given point with respect to the line.
* From two lines, yield a point that is the intersection of the lines.



The syntax of the expression is denoted by following BNF:


<expression>      ::= <point>
<point>       	  ::= <point-factor> | <line> "@" <line-factor> | <line> "@" <point-factor> | <point> "@" <line-factor>
<point-factor>    ::= "(" <number> "," <number> ")" | "(" <point> ")"
<line>            ::= <line-factor> | <point> "@" <point-factor>
<line-factor>     ::= "(" <line> ")"
<number>          ::= <zero-digit> | <positive-number> | <negative-number>
<positive-number> ::= <nonzero-digit> | <positive-number> <digit>
<negative-number> ::= "-" <positive-number>
<digit>           ::= <zero-digit> | <nonzero-digit>
<zero-digit>      ::= "0"
<nonzero-digit>   ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

Each <point> or <point-factor> denotes a point, whereas each <line> or <line-factor> denotes a line. The former notion of <point-factor> $(X,Y)$ represents a point which has $X$ for $x$-coordinate and $Y$ for $y$-coordinate on the $2$-dimensional plane. "@" indicates the operations on two operands. Since each operation is distinguishable from others by its operands' types (i.e. a point or a line), all of these operations are denoted by the same character "@". Note that "@" is left-associative, as can be seen from the BNF.

Your task is to determine where the treasure is placed.

Input

The input consists of multiple datasets. Each dataset is a single line which contains an expression denoting the position of treasure.

It is guaranteed that each dataset satisfies the following conditions:

* The length of the string never exceeds $10^2$.
* If both operands of "@" are points, their distance is greater than $1$.
* If both operands of "@" are lines, they are never parallel.
* The absolute values of points' coordinates never exceed $10^2$ at any point of evaluation.



You can also assume that there are at most $100$ datasets.

The input ends with a line that contains only a single "#".

Output

For each dataset, print the $X$ and $Y$ coordinates of the point, denoted by the expression, in this order.

The output will be considered correct if its absolute or relative error is at most $10^{-2}$.

Sample Input


((0,0)@(1,1))@((4,1)@(2,5))
((0,0)@(3,1))@((1,-3)@(2,-1))
(0,0)@(1,1)@(4,1)
(0,0)@((1,1)@(4,1))
(((0,0)@((10,20)@(((30,40))))))
((0,0)@(3,1))@((1,-3)@(2,-1))@(100,-100)@(100,100)


Output for the Sample Input


3.00000000 3.00000000
3.00000000 1.00000000
1.00000000 4.00000000
0.00000000 2.00000000
-10.00000000 10.00000000
-99.83681795 -91.92248853





Example

Input

((0,0)@(1,1))@((4,1)@(2,5))
((0,0)@(3,1))@((1,-3)@(2,-1))
(0,0)@(1,1)@(4,1)
(0,0)@((1,1)@(4,1))
(((0,0)@((10,20)@(((30,40))))))
((0,0)@(3,1))@((1,-3)@(2,-1))@(100,-100)@(100,100)
#


Output

3.00000000 3.00000000
3.00000000 1.00000000
1.00000000 4.00000000
0.00000000 2.00000000
-10.00000000 10.00000000
-99.83681795 -91.92248853

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define EPS 1e-10
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

class Point{
public:
	double x,y;
	Point(){}
	Point(double xx,double yy){
		x=xx;
		y=yy;
	}
	Point operator +(Point p){
		return Point(x+p.x,y+p.y);
	}
	Point operator -(Point p){
		return Point(x-p.x,y-p.y);
	}
	Point operator *(double a){
		return Point(a*x,a*y);
	}

	Point operator/(double a){
		return Point(x/a,y/a);
	}
	double abs(){
		return sqrt(norm());
	}
	double norm(){
		return x*x+y*y;
	}
	bool operator ==(const Point &p)const{
		return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
	}
};

typedef Point Vector;
struct Segment{
	Point p1,p2;
	Segment(){}
	Segment(Point pp1,Point pp2){
		p1=pp1;
		p2=pp2;
	}
};

typedef Segment Line;

double norm(Vector v){
	return v.x*v.x+v.y*v.y;
}

double dot(Vector a,Vector b){
	return a.x*b.x+a.y*b.y;
}

double cross(Vector a,Vector b){
	return a.x*b.y-a.y*b.x;
}

Point project(Segment s,Point p){
	Vector base=s.p2-s.p1;
	double r=dot(p-s.p1,base)/norm(base);
	return s.p1+base*r;
}

Point reflect(Segment s,Point p){
	return p+(project(s,p)-p)*2.0;
}

Point getLineCrossPoint(Line l1,Line l2){
	Vector base=l1.p2-l1.p1;
	double a=cross(l2.p2-l2.p1,base);
	double b=cross(l1.p1-l2.p1,base);
	return l2.p1+(l2.p2-l2.p1)*b/a;
}

struct data{
	Line l;
	Point p;
	int type;
	data(){}
	data(Point p1){
		p=p1;
		type=0;
	}
	data(int i){
		type=i;
	}
	data(data d1,data d2){
		if(d1.type==-1){
			p=d2.p;
			l=d2.l;
			type=d2.type;
		}else if(d2.type==-1){
			p=d1.p;
			l=d1.l;
			type=d1.type;
		}
		if(d1.type==0 && d2.type==0){
			l=Line(d1.p,d2.p);
			type=1;
		}
		if(d1.type==1 && d2.type==0){
			p=reflect(d1.l,d2.p);
			type=0;
		}
		if(d1.type==0 && d2.type==1){
			p=reflect(d2.l,d1.p);
			type=0;
		}
		if(d1.type==1 && d2.type==1){
			p=getLineCrossPoint(d1.l,d2.l);
			type=0;
		}
	}
};


typedef string::const_iterator State;
data expression(State &begin);

double number(State &begin){
	double ret=0;
	int flag=0;
	if(*begin=='-'){
		flag=1;
		begin++;
	}
	while(isdigit(*begin)){
		ret*=10.0;
		ret+=(double)(*begin-'0');
		begin++;
	}
	if(flag==1)ret=-ret;
	return ret;
}

bool isnumber(State &begin){
	if(*begin=='-' || isdigit(*begin))return true;
	return false;
}

data factor(State &begin){
	if(*begin=='('){
		begin++;
		data d=expression(begin);
		begin++;
		return d;
	}else if(isnumber(begin)){
		double d1=number(begin);
		begin++;
		double d2=number(begin);
		return data(Point(d1,d2));
	}else{
		return data(-1);
	}
}

data expression(State &begin){
	data d=factor(begin);
	while(1){
		if(*begin=='@'){
			begin++;
			d=data(d,factor(begin));
		}else{
			break;
		}
	}
	return d;
}


int main(void){
	while(1){
		string str;
		cin >> str;
		if(str=="#")break;
		State s=str.begin();
		Point ans=expression(s).p;
		printf("%.10f %.10f\n",ans.x,ans.y);
	}
	return 0;
}