#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
const D EPS = 1e-9;    // ?¨±??????????????????????????£????????????
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)
D dot(P a, P b) {return (conj(a)*b).X; }
D cross(P a, P b) {  return (conj(a)*b).Y;}
int ccw(P a, P b, P c) {
  b -= a;  c -= a;
  if (cross(b,c) >  EPS) return +1;  // counter clockwise
  if (cross(b,c) < -EPS) return -1;  // clockwise
  if (dot(b,c)   < -EPS) return +2;  // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line or a==b
  return 0;                          // a--c--b on line or a==c or b==c
}
bool isecLP(P a1, P a2, P b) {
  return abs(ccw(a1, a2, b)) != 1;  // return EQ(cross(a2-a1, b-a1), 0); ??¨??????
}

bool isecLL(P a1, P a2, P b1, P b2) {
  return !isecLP(a2-a1, b2-b1, 0) || isecLP(a1, b1, b2);
}

bool isecLS(P a1, P a2, P b1, P b2) {
  return cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS;
}

bool isecSS(P a1, P a2, P b1, P b2) {
  return ccw(a1, a2, b1)*ccw(a1, a2, b2) <= 0 &&
         ccw(b1, b2, a1)*ccw(b1, b2, a2) <= 0;
}

bool isecSP(P a1, P a2, P b) {
  return !ccw(a1, a2, b);
}

P proj(P a1, P a2, P p) {
  return a1 + dot(a2-a1, p-a1)/norm(a2-a1) * (a2-a1);
}

P reflection(P a1, P a2, P p) {
  return 2.0*proj(a1, a2, p) - p;
}
 
D distLP(P a1, P a2, P p) {
  return abs(proj(a1, a2, p) - p);
}
 
D distLL(P a1, P a2, P b1, P b2) {
  return isecLL(a1, a2, b1, b2) ? 0 : distLP(a1, a2, b1);
}
 
D distLS(P a1, P a2, P b1, P b2) {
  return isecLS(a1, a2, b1, b2) ? 0 : min(distLP(a1, a2, b1), distLP(a1, a2, b2));
}
 
D distSP(P a1, P a2, P p) {
  P r = proj(a1, a2, p);
  if (isecSP(a1, a2, r)) return abs(r-p);
  return min(abs(a1-p), abs(a2-p));
}
 
D distSS(P a1, P a2, P b1, P b2) {
  if (isecSS(a1, a2, b1, b2)) return 0;
  return min(min(distSP(a1, a2, b1), distSP(a1, a2, b2)),
             min(distSP(b1, b2, a1), distSP(b1, b2, a2)));
}

P crosspointLL(P a1, P a2, P b1, P b2) {
  D d1 = cross(b2-b1, b1-a1);
  D d2 = cross(b2-b1, a2-a1);
  if (EQ(d1, 0) && EQ(d2, 0)) return a1;  // same line
  if (EQ(d2, 0)) throw "kouten ga nai";   // ???????????????
  return a1 + d1/d2 * (a2-a1);
}
string s;
int p=0;
typedef struct{
  int x;
  P p1,p2;
} P1;
P1 marge(P1 a,P1 b){
  P1 res;
  res.x=1;
  if(a.x==1&&b.x==2)swap(a,b);
  if(a.x==1&&b.x==1){
    res.x=2;
    res.p1=a.p1;
    res.p2=b.p1;
  }
  else if(a.x==2&&b.x==1){
    res.p1=reflection(a.p1,a.p2,b.p1);
  }
  else{
    res.p1=crosspointLL(a.p1,a.p2,b.p1,b.p2);
  }
  return res;
}
P1 bnf();
P1 get(){
  P1 res;
  res.x=1;
  if(s[p]=='(')p++,res=bnf(),p++;
  else{
    int f=0,g=0;
    double x=0,y=0;
    if(s[p]=='-')f++,p++;
    while(isdigit(s[p]))x=x*10+(s[p++]-'0');
    p++;
    if(s[p]=='-')g++,p++;
    while(isdigit(s[p]))y=y*10+(s[p++]-'0');
    if(f)x-=x*2;
    if(g)y-=y*2;
    res.p1=P(x,y);
  }
  return res;
}
P1 bnf(){
  P1 res=get();
  while(s[p]=='@'){
    p++;
    P1 t=get();
    res=marge(t,res);
  }
  return res;
}
main(){
  while(cin>>s,s!="#"){
    p=0;
    P1 ans=bnf();
    printf("%.9f %.9f\n",ans.p1.X,ans.p1.Y);
  }
}

Measured memory_bytes: 3368