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 REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;
typedef complex<double> Point;
struct Line : public vector<Point> {
    Line(const Point& a, const Point& b) {
        push_back(a); push_back(b);
    }
    Point vector() const {
        return back() - front();
    }
};
const double EPS = 1e-8;
int sign(double a){
    if(a > EPS) return +1;
    if(a < -EPS) return -1;
    return 0;
}
double dot(Point a, Point b){
    return real(conj(a) * b);
}
double cross(Point a, Point b){
    return imag(conj(a) * b);
}
Point projection(Line l, Point p){
    double t = dot(p - l[0], l.vector()) / norm(l.vector());
    return l[0] + t * l.vector();
}
Point crosspointLL(Line l, Line m){
    double A = cross(l.vector(), m.vector());
    double B = cross(l.vector(), l[1] - m[0]);
    if(sign(A) == 0 && sign(B) == 0) return m[0]; // 二直線が重なっている
    if(sign(A) == 0) assert(false); // 直線が交わらない
    return m[0] + m.vector() * B / A;
}

// 点pの直線lに関する反射
Point reflection(Line l, Point p){
    return 2.0 * projection(l, p) - p;
}
string s;
struct Result{
    int idx;
    vector<Point> val;
};

void skip(int& k, char c) {
    if(s[k] != c) {
        printf("expect s[%d] is %c but %c\n", k, c, s[k]);
        assert(false);
    }
    k++;
}

vector<Point> ope(vector<Point> v, vector<Point> w) {
    if(v.size() > w.size()) swap(v, w);
    if(v.size() == 1 && w.size() == 1) {
        //cout << v[0] << "@" << w[0] << endl;
        return {v[0], w[0]};
    } else if(v.size() == 1 && w.size() == 2) {
        //cout << v[0] << "@" << "(" << w[0] << ", " << w[1] << ")" << endl;
        return {reflection({w[0], w[1]}, v[0])};
    } else if(v.size() == 2 && w.size() == 2) {
        //cout << "(" << v[0] << ", " << v[1] << ") " << "@" << "(" << w[0] << ", " << w[1] << ")" << endl;
        return {crosspointLL({w[0], w[1]}, {v[0], v[1]})};
    }
}

Result term(int k);
Result expr(int k) {
    Result r = term(k);
    while(r.idx < s.size() && s[r.idx] == '@') {
        skip(r.idx, '@');
        Result t = term(r.idx);
        r.val = ope(r.val, t.val);
        r.idx = t.idx;
    }
    return r;
}

int number(int& k) {
    int sign = 1;
    if(s[k] == '-') {
        skip(k, '-');
        sign = -1;
    }
    int p = 0;
    while(isdigit(s[k])) {
        p = p * 10 + (s[k++] - '0');
    }
    return p * sign;
}

Result term(int k) {
    if(k + 1 < s.size() && s[k] == '(' && (isdigit(s[k + 1]) || s[k + 1] == '-')) {
        skip(k, '(');
        int p = number(k);
        skip(k, ',');
        int q = number(k);
        skip(k, ')');
        return {k, {Point(p, q)}};
    } else {
        Result r = expr(k + 1);
        skip(r.idx, ')');
        return {r.idx, {r.val}};
    }
}

int main(){
    while(cin >> s && s != "#") {
        Result res = expr(0);
        assert(res.val.size() == 1);
        printf("%.12f %.12f\n", res.val[0].real(), res.val[0].imag());
    }
    return 0;
}