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<iostream>
#include<iomanip>
#include<vector>
#include<complex>
#include<map>
#include<cstdlib>
#include<cstdio>

#define EQ(a,b) (abs((a)-(b)) < EPS)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define sz size()
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef double D;
typedef complex<D> P;
typedef pair<P,P> L;

const D EPS = 1e-8;
const D PI = acos(-1);

inline pair<P,P> normal(P p){return make_pair(p*P(0,1),p*P(0,-1));}
inline D dot(P x, P y){return real(conj(x)*y);}
inline D cross(P x, P y){return imag(conj(x)*y);}


inline P line_cp(L a,L b){
  return a.fs+(a.sc-a.fs)*cross(b.sc-b.fs,b.fs-a.fs)/cross(b.sc-b.fs,a.sc-a.fs);
}

inline P symmetry(L a, P p){
  L b = L(p, p + normal(a.fs-a.sc).fs);
  P m = line_cp(a,b);
  return 2.0*m - p;
}

vector<P> parse(int l, int r, const string &s){
  int k = 0;
  vector<P> res;

  for(int i=r-1;i>=l;i--){
    if(s[i] == '(')k++;
    if(s[i] == ')')k--;
    
    if(k==0){
      if(s[i] == '@'){
	vector<P> a = parse(l,i,s), b = parse(i+1,r,s);
	if(a.sz==2 && b.sz==2){
	  res.pb( line_cp(L(a[0],a[1]), L(b[0],b[1])) );
	  return res;
	}
	if(a.sz==1 && b.sz==1){
	  res.pb(a[0]); res.pb(b[0]);
	  return res;
	}
	if(a.sz==2){
	  res.pb( symmetry( L(a[0],a[1]), b[0] ) );
	  return res;
	}
	if(a.sz==1){
	  res.pb( symmetry( L(b[0],b[1]), a[0] ) );
	  return res;
	}
      }
    }
  }

  bool exist = false;
  for(int i=l;i<r;i++){
    if(s[i] == '@')exist = true;
  }
  if(exist)return parse(l+1,r-1,s);

  k = 0;
  for(int i=l;i<r;i++){
    if(s[i] == '(')k++;
  }
  if(k>1)return parse(l+k-1,r-k+1,s);

  int pos = 0;
  for(int i=l;i<r;i++){
    if(s[i] == ',')pos = i;
  }
  
  res.pb( P( atoi( s.substr(l+1,pos-l-1).c_str() ),
	     atoi( s.substr(pos+1,r-1-pos-1).c_str() ) ) );
  return res;
}

int main(){
  string s;
  while(cin >> s){
    if(s == "#")return 0;

    vector<P> res = parse(0,s.size(),s);
    cout << fixed << setprecision(10) << res[0].real() << " " << res[0].imag() << endl;
  }
}