#include <bits/stdc++.h>
using namespace std;
int main() {
  string A = "", B = "";
  bool o = 0, t = 0;
  vector<string> a(100005, "");
  vector<bool> b(100005, 0);
  char x;
  int i = 0, n = 1;
  while (cin >> x) {
    if (x == ';' || x == ',')
      i++, n++;
    else
      a[i] += x;
  }
  for (int i = 0; i < n; i++) {
    if (!(a[i][0] == '0' && a[i].length() > 1))
      for (int j = 0; j < a[i].length(); j++) {
        if (!isdigit(a[i][j])) break;
        if (j == a[i].length() - 1) b[i] = 1;
      }
    if (b[i])
      A += a[i] + ",";
    else
      B += a[i] + ",";
  }
  if (A.length() == 0)
    A = "-", o = 1;
  else
    A.erase(A.length() - 1, 1);
  if (B.length() == 0)
    B = "-", t = 1;
  else
    B.erase(B.length() - 1, 1);
  if (o)
    cout << A << endl << "\"" << B << "\"";
  else if (t)
    cout << "\"" << A << "\"" << endl << B;
  else
    cout << "\"" << A << "\"" << endl << "\"" << B << "\"";
}
