#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);++i)
#define rep2(i,a,b) for (int i=(a);i<(b);++i)
#define rrep(i,n) for (int i=(n)-1;i>=0;--i)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;--i)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cout<<(#v)<<":";for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;
#define printVS(vs) cout<<(#vs)<<":"<<endl;for(auto(s):(vs)){cout<<(s)<< endl;}
#define printVV(vv) cout<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;}
#define printP(p) cout<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cout<<(#vp)<<":"<<endl;for(auto(p):(vp)){cout<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cout << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cout << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using TUPLE = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 1e9;
const int mod = 1e9 + 7;
using Graph = vector<vector<int>>;

typedef complex<double> P;
typedef vector<P> G;
#define here(g, i) g[i]
#define next(g, i) g[(i + 1) % g.size()]
#define prev(g, i) g[(i - 1 + g.size()) % g.size()]
const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);
inline int sgn(double a, double b = 0) { return a < b - EPS ? -1 : a > b + EPS ? 1 : 0; }

P readP() {
    double x, y;
    cin >> x >> y;
    return P(x, y);
}

struct L {
    P a, b, v, h;
    L(){}
    L(P _a, P _b) : a(_a), b(_b), v(b - a), h(v / abs(v) * P(0, 1)) {}
    L(double _ax, double _ay, double _bx, double _by) : L(P(_ax, _ay), P(_bx, _by)) {}
    void trans(double d) {
        a += d * h;
        b += d * h;
    }
    void print() {
        cerr << "{(" << a.real() << ", " << a.imag() << "), (" << b.real() << ", " << b.imag() << ")}" << endl;
    }
};

double cross(P a, P b) {
    return imag(conj(a) * b);
}

double dot(P a, P b) {
    return real(conj(a) * b);
}

P crosspointLL(L l1, L l2) {
    return l1.a + l1.v * cross(l2.v, l2.a - l1.a) / cross(l2.v, l1.v);
}

P projection(P x, P d) {
    return dot(x, d) * d / abs(d) / abs(d);
}

P reflection(P x, P d) {
    P t = projection(x, d);
    return 2. * t - x;
}

P reflectionPL(P p, L l) {
    return reflection(p - l.a, l.b - l.a) + l.a;
}

enum TermType { POINT, LINE };
struct Data {
    TermType type;
    vector<P> p;
    void print() {
        cerr << "TermType = " << (type ? "LINE" : "POINT") << ":";
        for (auto pp : p) {
            cerr << "(" << pp.real() << ", " << pp.imag() << "), ";
        }
        cerr << endl;
    }
};

Data merge(Data d1, Data d2) {
    if (d1.type == POINT && d2.type == POINT) {
        return Data{LINE, vector<P>{d1.p[0], d2.p[0]}};
    }
    else if (d1.type == LINE && d2.type == LINE) {
        return Data{POINT, vector<P>{crosspointLL(L(d1.p[0], d1.p[1]), L(d2.p[0], d2.p[1]))}};
    }
    else {
        if (d1.type == LINE) {
            swap(d1, d2);
        }
        // d1: POINT, d2: LINE
        return Data{POINT, vector<P>{reflectionPL(d1.p[0], L(d2.p[0], d2.p[1]))}};
    }
}

Data point(string s, int l, int r) {
    rep2(i, l, r) {
        if (s[i] == ',') {
            return Data{POINT, vector<P>{P(stof(s.substr(l + 1, i - l - 1)), stof(s.substr(i + 1, r - i - 2)))}};
        }
    }
}

Data solve(string s, int l, int r) {
    int depth = 0;
    int ma_depth = 0;
    rrep2(i, r, l) {
        if (s[i] == ')') {
            depth++;
            chmax(ma_depth, depth);
        }
        else if (s[i] == '(') {
            depth--;
        }
        else if (depth == 0 && s[i] == '@') {
            auto d1 = solve(s, l, i), d2 = solve(s, i + 1, r);
            auto d = merge(d1, d2);
            return d;
        }
    }

    // no '@' s.t. depth = 0
    if (ma_depth >= 2) {
        // (<exp>)
        return solve(s, l + 1, r - 1);
    }
    else {
        // <point>
        return point(s, l, r);
    }
}

main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    string s;
    while (cin >> s, s != "#") {
        int n = s.size();
        auto ans = solve(s, 0, n);
        assert(ans.type == POINT);
        cout << fixed << setprecision(10) << ans.p[0].real() << " " << ans.p[0].imag() << endl;
    }
}

Measured memory_bytes: 3308