#include <bits/stdc++.h>

using namespace std;

const double EPS = 1e-8, PI = acos(-1);

inline bool eq(double a, double b) { return fabs(b - a) < EPS; }

struct Point
{
  double x, y;

  Point() {}

  Point(double x, double y) : x(x), y(y) {}

  Point operator+(const Point &b) const { return Point(x + b.x, y + b.y); }

  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }

  Point operator*(const double b) const { return Point(x * b, y * b); }

  Point operator*(const Point &b) const { return Point(x * b.x - y * b.y, x * b.y + y * b.x); }

  Point operator/(const double b) const { return Point(x / b, y / b); }

  bool operator<(const Point &b) const { return x != b.x ? x < b.x : y < b.y; }

  bool operator==(const Point &b) const { return eq(x, b.x) && eq(y, b.y); }

  double norm() { return x * x + y * y; }

  double arg() { return atan2(x, y); }

  double abs() { return sqrt(norm()); }

  Point rotate(double theta) { return Point(cos(theta) * x - sin(theta) * y, sin(theta) * x + cos(theta) * y); }

  Point rotate90() { return Point(-y, x); }

  friend ostream &operator<<(ostream &os, Point &p) { return os << "(" << p.x << "," << p.y << ")"; }

  friend istream &operator>>(istream &is, Point &a) { return is >> a.x >> a.y; }
};

double cross(const Point &a, const Point &b)
{
  return a.x * b.y - a.y * b.x;
}

double dot(const Point &a, const Point &b)
{
  return a.x * b.x + a.y * b.y;
}

struct Line
{
  Point a, b;

  Line() {};

  Line(Point a, Point b) : a(a), b(b) {};

  friend ostream &operator<<(ostream &os, Line &p) { return os << "(" << p.a.x << "," << p.a.y << ") to (" << p.b.x << "," << p.b.y << ")"; }

  friend istream &operator>>(istream &is, Line &a) { return is >> a.a.x >> a.a.y >> a.b.x >> a.b.y; }
};

Point Projection(const Line &l, const Point &p)
{
  double t = dot(p - l.a, l.a - l.b) / (l.a - l.b).norm();
  return l.a + (l.a - l.b) * t;
}

Point Reflection(const Line &l, const Point &p)
{
  return p + (Projection(l, p) - p) * 2.0;
}

Point Crosspoint(const Line &l, const Line &m)
{
  double A = cross(l.b - l.a, m.b - m.a);
  double B = cross(l.b - l.a, l.b - m.a);
  if(abs(A) < EPS && abs(B) < EPS) return m.a;
  return m.a + (m.b - m.a) * B / A;
}


struct Beet
{
  int type;
  Point p;
  Line l;
};

string S;
int idx;

int num()
{
  int f = 1;
  if(S[idx] == '-') f *= -1, ++idx;
  int ret = 0;
  while(isdigit(S[idx])) ret = ret * 10 + S[idx++] - '0';
  return (f * ret);
}

Beet point();

Beet factor()
{
  ++idx;
  if(isdigit(S[idx]) || S[idx] == '-') {
    auto latte = num();
    ++idx;
    auto malta = num();
    ++idx;
    Beet beet;
    beet.type = 0;
    beet.p = Point(latte, malta);
    return (beet);
  } else {
    auto p = point();
    ++idx;
    return (p);
  }
}

Beet point()
{
  Beet ret = factor();
  while(idx < S.size() && S[idx] == '@') {
    ++idx;
    Beet res = factor(), nxt;
    if(ret.type == 0 && res.type == 0) {
      nxt.type = 1;
      nxt.l = Line(ret.p, res.p);
    } else if(ret.type == 1 && res.type == 1) {
      nxt.type = 0;
      nxt.p = Crosspoint(ret.l, res.l);
    } else if(ret.type == 0 && res.type == 1) {
      nxt.type = 0;
      nxt.p = Reflection(res.l, ret.p);
    } else {
      nxt.type = 0;
      nxt.p = Reflection(ret.l, res.p);
    }
    swap(nxt, ret);
  }
  return (ret);
}

int main()
{

  while(cin >> S, S != "#") {
    idx = 0;
    auto p = point();
    assert(p.type == 0);
    cout << fixed << setprecision(10) << p.p.x << " " << p.p.y << endl;
  }
}

Measured memory_bytes: 3268