#include <bits/stdc++.h>
using namespace std;
string s, q;
bool flg = 1;
vector<string> vecn, veco;
int main() {
  cin.tie(0);
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == ',' || s[i] == ';' || i == s.length() - 1) {
      if (i == s.length() - 1 && s[i] != ',' && s[i] != ';') {
        q += s[i];
        if (s[i] < '0' || s[i] > '9') flg = 0;
      }
      if (q[0] == '0' && q.length() > 1) flg = 0;
      if (q == "" || (!flg && q != "0"))
        veco.push_back(q);
      else
        vecn.push_back(q);
      q = "";
      flg = 1;
    } else {
      q += s[i];
      if ((s[i] < '0' || s[i] > '9') || (q == "" && s[i] == '0')) flg = 0;
    }
  }
  if (s[s.length() - 1] == ',' || s[s.length() - 1] == ';') veco.push_back("");
  if (((int(vecn.size()))) == 0)
    cout << "-";
  else {
    cout << '"';
    for (int i = 0; i < ((int(vecn.size()))); i++) {
      cout << vecn[i];
      if (i < ((int(vecn.size()))) - 1) cout << ",";
    }
    cout << '"';
  }
  cout << endl;
  if (((int(veco.size()))) == 0)
    cout << "-";
  else {
    cout << '"';
    for (int i = 0; i < ((int(veco.size()))); i++) {
      cout << veco[i];
      if (i < ((int(veco.size()))) - 1) cout << ",";
    }
    cout << '"';
  }
  return 0;
}
