#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;
typedef complex<double> Complex;

struct data {
  bool line;
  Complex p, q;
};

string S;
ll p;

ll number() {
  ll sign = 1;
  if(S[p] == '-') {
    sign = -1;
    p++;
  }
  ll d = 0;
  while(p < S.length() && '0' <= S[p] && S[p] <= '9') {
    d = d * 10 + (S[p++] - '0');
  }
  return sign * d;
}

double det(Complex a, Complex b) {
  return a.real() * b.imag() - a.imag() * b.real();
}

Complex cross_point(Complex a, Complex b, Complex c, Complex d) {
  Complex u = b - a;
  Complex v = d - c;
  double p1 = u.imag(), q1 = -u.real(), r1 = -det(u, a);
  double p2 = v.imag(), q2 = -v.real(), r2 = -det(v, c);
  double t = p1 * q2 - p2 * q1;
  double x = (r1 * q2 - r2 * q1) / t;
  double y = (r2 * p1 - r1 * p2) / t;
  return Complex(x, y);
}

Complex opposite_point(Complex a, Complex p, Complex q) {
  Complex d = Complex((p - q).imag(), -(p - q).real());
  Complex s = cross_point(a, a + d, p, q);
  return a + (s - a) * 2.0;
}

data calc(data a, data b) {
  if(!a.line && !b.line) {
    return (data) { true, a.p, b.p };
  }
  if(a.line && b.line) {
    return (data) { false, cross_point(a.p, a.q, b.p, b.q) };
  }
  if(a.line && !b.line) swap(a, b);
  return (data) { false, opposite_point(a.p, b.p, b.q) };
}

data dfs() {
  data ret;
  if(S[p] != '(') {
    ret.line = false;
    ll x = number();
    p++;
    ll y = number();
    ret.p = Complex(x, y);
  } else {
    p++;
    ret = dfs();
    p++;
    while(p < S.length() && S[p] == '@') {
      p++;
      p++;
      data s = dfs();
      p++;
      ret = calc(ret, s);
    }
  }
  return ret;
}

int main(void) {
  while(cin >> S, S != "#") {
    p = 0;
    data ans = dfs();
    printf("%.15lf %.15lf\n", ans.p.real(), ans.p.imag());
  }
}
