#include <bits/stdc++.h>
using namespace std;
bool ok(const string& w) {
  if (!w.size()) return false;
  for (int i = 0; i < w.size(); i++) {
    if (w[i] < '0' || w[i] > '9') return false;
  }
  return w == "0" || w[0] != '0';
}
void print(const vector<string>& x) {
  if (!x.size()) {
    cout << "-" << endl;
    return;
  }
  cout << '"';
  for (int i = 0; i < x.size(); i++) {
    if (i > 0) cout << ',';
    cout << x[i];
  }
  cout << '"' << endl;
}
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  s.push_back(',');
  vector<string> a, b;
  int start = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ',' || s[i] == ';') {
      string w = s.substr(start, i - start);
      start = i + 1;
      if (ok(w)) {
        a.push_back(w);
      } else {
        b.push_back(w);
      }
    }
  }
  print(a);
  print(b);
  return 0;
}
