#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  vector<string> a, b;
  vector<string> v;
  string aux;
  s += ';';
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s[i] == ',' || s[i] == ';') {
      v.push_back(aux);
      aux.clear();
    } else {
      aux += s[i];
    }
  }
  for (int i = 0; i < (int)(v.size()); i++) {
    int ok = 1;
    for (int j = 0; j < (int)(v[i].size()); j++) {
      if (v[i][j] > '9' || v[i][j] < '0') {
        ok = 0;
        break;
      }
    }
    if (v[i][0] == '0' && v[i].size() == 1) {
      ok = 1;
    } else if (v[i][0] == '0') {
      ok = 0;
    }
    if (v[i].size() == 0) ok = 0;
    if (ok) {
      a.push_back(v[i]);
    } else {
      b.push_back(v[i]);
    }
  }
  if (a.size() == 0) {
    cout << '-' << '\n';
  } else {
    cout << '"';
    cout << a[0];
    for (int i = 1; i < (int)(a.size()); i++) {
      cout << ',' << a[i];
    }
    cout << '"' << '\n';
  }
  if (b.size() == 0) {
    cout << '-' << '\n';
  } else {
    cout << '"';
    cout << b[0];
    for (int i = 1; i < (int)(b.size()); i++) {
      cout << ',' << b[i];
    }
    cout << '"' << '\n';
  }
  return 0;
}
