#include <bits/stdc++.h>
using namespace std;

typedef double R;
typedef complex<R> D;
typedef pair<D, D> L;
#define fs first
#define sc second

inline R dot(const D &a, const D &b) {
    return real(a) * real(b) + imag(a) * imag(b);
}
inline R det(const D& a, const D& b) {
    return real(a) * imag(b) - imag(a) * real(b);
}
D projection(const L &l, const D &d) {
    R t = dot(d - l.fs, l.fs - l.sc) / norm(l.fs - l.sc);
    return l.fs + t * (l.fs - l.sc);
}
D inline refr(const L &l, const D &d) {
    return d + 2. * (projection(l, d) - d);
}
inline D vec(const L &l) { return l.sc - l.fs; }
D inline intersect(const L &l1, const L &l2) {
    R ratio = det(vec(l2), l2.fs - l1.fs) / det(vec(l2), vec(l1));
    return l1.fs + vec(l1) * ratio;
}

class Node {
    public:
        D a, b;
        Node(D a_ = {}, D b_ = {1e9, 1e9}):a(a_), b(b_){}
        inline bool is_point() {
            return b.real() > 1000.;
        }
};
Node refrection(Node x, Node y) {
    if (x.is_point()) swap(x, y);
    return Node(refr({x.a, x.b}, y.a));
}
Node intersection(Node x, Node y) {
    return Node(intersect({x.a, x.b}, {y.a, y.b}));
}

string s;
int idx;

Node pl();
Node plf();

int number() {
    bool is_neg = false;
    if (s[idx] == '-') {
        is_neg = true;
        idx++;
    }

    int ret = 0;
    while (isdigit(s[idx])) {
        ret = ret * 10 + (s[idx] - '0');
        idx++;
    }

    if (is_neg) ret *= -1;
    return ret;
}

Node pl() {
    Node left = plf();

    while (s[idx] == '@') {
        idx++;

        Node right = plf();
        if (left.is_point()) {
            if (right.is_point())
                left = Node(left.a, right.a);
            else
                left = refrection(left, right);
        } else {
            if (right.is_point())
                left = refrection(left, right);
            else
                left = intersection(left, right);
        }
    }

    return left;
}

Node plf() {
    Node ret;
    idx++; // skip '('
    if (s[idx] == '-' || isdigit(s[idx])) {
        double left = number();
        idx++;
        double right = number();
        ret = Node(D(left, right));
    } else {
        ret = pl();
    }
    idx++;
    return ret;
}


int main() {
    while (cin >> s, s != "#") {
        idx = 0;
        Node ret = pl();
        printf("%.8lf %.8lf\n", ret.a.real(), ret.a.imag());
    }
}

