#include "bits/stdc++.h"
using namespace std;
struct Point {
	double x, y;
	Point(double x = 0, double y = 0) :x(x), y(y) {}
	Point operator+(const Point p) const {
		return Point(x + p.x, y + p.y);
	}
	Point operator-(const Point p) const {
		return Point(x - p.x, y - p.y);
	}
	Point operator*(double k) const {
		return Point(x*k, y*k);
	}
};
Point operator*(double k, const Point p) {
	return Point(p.x*k, p.y*k);
}
typedef Point Vector;
struct Line {
	Point p1, p2;
	Line(Point p1 = Point(), Point p2 = Point()) :p1(p1), p2(p2) {}
};
struct Result {
	int type;
	Point p;
	Line l;
};
double dot(Vector a, Vector b) {
	return a.x*b.x + a.y*b.y;
}
double cross(Vector a, Vector b) {
	return a.x*b.y - a.y*b.x;
}
double norm(Vector v) {
	return v.x*v.x + v.y*v.y;
}
Point project(Line l, Point p) {
	Vector base = l.p2 - l.p1;
	double r = dot(p - l.p1, base) / norm(base);
	return l.p1 + base*r;
}
Point reflect(Line l, Point p) {
	return p + (project(l, p) - p)*2.0;
}
Point getCrossPoint(Line l1, Line l2) {
	double A = cross(l1.p2 - l1.p1, l2.p2 - l2.p1);
	double B = cross(l1.p2 - l1.p1, l1.p2 - l2.p1);
	return l2.p1 + B / A*(l2.p2 - l2.p1);
}
char s[101];
int pos;
Result term() {
	Result r;
	int cnt = 0;
	while (1) {
		Result t;
		pos++;
		if (s[pos] == '-' || isdigit(s[pos])) {
			bool minus = 0;
			if (s[pos] == '-') {
				minus = 1;
				pos++;
			}
			int x = 0;
			while (isdigit(s[pos])) {
				x *= 10;
				x += s[pos] - '0';
				pos++;
			}
			if (minus) x *= -1;
			pos++;
			int y = 0;
			minus = 0;
			if (s[pos] == '-') {
				minus = 1;
				pos++;
			}
			while (isdigit(s[pos])) {
				y *= 10;
				y += s[pos] - '0';
				pos++;
			}
			if (minus) y *= -1;
			pos++;
			t.type = 0;
			t.p = Point(x, y);
		}
		else {
			t = term();
		}
		if (cnt == 0) {
			r = t;
		}
		else if (r.type == 0 && t.type == 0) {
			Point p1 = r.p;
			Point p2 = t.p;
			r.type = 1;
			r.l.p1 = p1;
			r.l.p2 = p2;
		}
		else if (r.type == 0 && t.type == 1) {
			Point p = r.p;
			Line l = t.l;
			r.type = 0;
			r.p = reflect(l, p);
		}
		else if (r.type == 1 && t.type == 0) {
			Point p = t.p;
			Line l = r.l;
			r.type = 0;
			r.p = reflect(l, p);
		}else {
			Line l1 = r.l;
			Line l2 = t.l;
			r.type = 0;
			r.p = getCrossPoint(l1, l2);
		}
		if (s[pos] != '@') break;
		pos++;
		cnt++;
	}
	pos++;
	return r;
}
int main() {
	while (cin >> s, s[0] != '#') {
		pos = 0;
		Result r = term();
		printf("%.15lf %.15lf\n", r.p.x, r.p.y);
	}
}
