#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1);
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
inline double ABS(double a){return max(a,-a);}
struct Pt {
	double x, y;
	Pt() {}
	Pt(double x, double y) : x(x), y(y) {}
	Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); }
	Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); }
	Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); }
	Pt operator-() const { return Pt(-x, -y); }
	Pt operator*(const double &k) const { return Pt(x * k, y * k); }
	Pt operator/(const double &k) const { return Pt(x / k, y / k); }
	double ABS() const { return sqrt(x * x + y * y); }
	double abs2() const { return x * x + y * y; }
	double arg() const { return atan2(y, x); }
	double dot(const Pt &a) const { return x * a.x + y * a.y; }
	double det(const Pt &a) const { return x * a.y - y * a.x; }
};
double tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); }
Pt pLL(Pt a, Pt b, Pt c, Pt d) {
	b = b - a; d = d - c; return a + b * (c - a).det(d) / b.det(d);
}
Pt hLP(Pt a,Pt b,Pt c){
	return pLL(a,b,c,c+(b-a)*Pt(0,1));
}
int cur;
char str[110];
struct wolf{
	Pt a;
	Pt b;
	int t;
};
wolf expr();
wolf term(){
	if(str[cur]=='('){
		cur++;
		wolf ret=expr();
		cur++;
		return ret;
	}
	int x=0;
	bool neg=false;
	if(str[cur]=='-'){cur++;neg=true;}
	while('0'<=str[cur]&&str[cur]<='9'){
		x*=10;x+=str[cur]-'0';cur++;
	}
	if(neg)x=-x;
	neg=false;
	cur++;
	int y=0;
	if(str[cur]=='-'){cur++;neg=true;}
	while('0'<=str[cur]&&str[cur]<='9'){
		y*=10;y+=str[cur]-'0';cur++;
	}
	if(neg)y=-y;
	wolf ret;
	ret.a=Pt((double)x,(double)y);
	ret.t=0;
	//printf("%d, %d\n",x,y);
	return ret;
}
wolf expr(){
	wolf ret=term();
	while(str[cur]=='@'){
		cur++;
		wolf tmp=term();
		if(ret.t<tmp.t){
			swap(ret,tmp);
		}
		wolf to;
		if(ret.t==0&&tmp.t==0){
			to.t=1;
			to.a=ret.a;
			to.b=tmp.a;
		}else if(ret.t==1&&tmp.t==0){
			to.t=0;
			Pt v=hLP(ret.a,ret.b,tmp.a);
			to.a=v+v-tmp.a;
		}else{
			to.t=0;
			to.a=pLL(ret.a,ret.b,tmp.a,tmp.b);
		}
		ret=to;
	}
	return ret;
}
int main(){
	while(1){
		scanf("%s",str);
		if(str[0]=='#')break;
		cur=0;
		wolf ret=expr();
		printf("%.12f %.12f\n",ret.a.x,ret.a.y);
	}
}