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

const double EPS = 1e-8;

typedef complex<double> P;
typedef pair<P,P> L;

struct data{
  P p;
  L l;
  bool is_p, correct;
  data(P p):p(p),is_p(true), correct(true){}
  data(L l):l(l),is_p(false), correct(true){}
  data():correct(false){}
};

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

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

P proj(P p, L l){
    return l.first + dot(p - l.first, l.second - l.first) / norm(l.second - l.first) * (l.second - l.first);
}

P reflect(P p, L l){
  return p + (proj(p,l) - p) * 2.0;
}

P crossPoint(L l, L m){
  double A = cross(l.second - l.first, m.second - m.first);
  double B = cross(l.second - l.first, l.second - m.first);
  if(fabs(A) < EPS && fabs(B) < EPS) return m.first;
  else if(fabs(A) >= EPS) return m.first + B / A * (m.second - m.first);
}


data func(const string &str, int &pos);
data exp(const string &str, int &pos){
  data x = func(str, pos);
  
  while(pos < str.size() && str[pos] == '@'){
    pos++;
    data y = func(str, pos);

    if(x.is_p && y.is_p){
      x = data(L(x.p, y.p));
    } else if(!x.is_p && !y.is_p){
      x = data(crossPoint(x.l, y.l));
    } else {
      if(!x.is_p) swap(x, y);
      x = data(reflect(x.p, y.l));
    }
  }

  return x;
}

data func(const string &str, int &pos){
  data res = data();

  if(pos >= str.size()-1);
  else if(str[pos] == '(' && str[pos+1] == '('){
    pos++;
    res = exp(str, pos);
    pos++;
  } else if(str[pos] == '(' && (str[pos+1] >= '0' && str[pos+1] <= '9' || str[pos+1] == '-')){
    pos++;
    double x = 0, y = 0;
    bool is_minus = false;
    if(str[pos] == '-'){
      pos++;
      is_minus = true;
    }
    while(str[pos] >= '0' && str[pos] <= '9'){
      x *= 10;
      x += str[pos] - '0';
      pos++;
    }
    if(is_minus) x *= -1;

    pos++;

    is_minus = false;
    if(str[pos] == '-'){
      pos++;
      is_minus = true;
    }
    while(str[pos] >= '0' && str[pos] <= '9'){
      y *= 10;
      y += str[pos] - '0';
      pos++;
    }
    if(is_minus) y *= -1;

    pos++;
    res = data(P(x, y));
  }

  return res;
}

P solve(const string &str){
  int pos = 0;
  return exp(str, pos).p;
}

int main(){
  string str;
  while(cin >> str && str != "#"){
    P ans = solve(str);
    printf("%.8f %.8f\n", real(ans), imag(ans));
  }
}