#include <bits/stdc++.h>
using namespace std;
int n;
string s, a = "", b = "";
void read() {
  cin >> s;
  s += ";";
  n = (int)s.size();
}
void solve() {
  int i;
  string cur = "";
  bool is_number = true;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (s[i] == ';' || s[i] == ',') {
      if (!is_number || (int)cur.size() == 0 ||
          ((int)cur.size() > 1 && cur[0] == '0')) {
        b += cur;
        b += ",";
      } else {
        a += cur;
        a += ",";
      }
      cur = "";
      is_number = true;
    } else {
      if (!(s[i] >= '0' && s[i] <= '9')) is_number = false;
      cur += s[i];
    }
  }
  if ((int)a.size() == 0)
    cout << "-" << endl;
  else {
    cout << '"';
    for (int i = 0; i < (int)a.size() - 1; ++i) {
      printf("%c", a[i]);
    }
    cout << '"' << endl;
  }
  if ((int)b.size() == 0)
    cout << "-" << endl;
  else {
    cout << '"';
    for (int i = 0; i < (int)b.size() - 1; ++i) {
      printf("%c", b[i]);
    }
    cout << '"' << endl;
  }
}
int main() {
  read();
  solve();
  return 0;
}
