#include <bits/stdc++.h>
using namespace std;
bool isMult = false;
void solve() {
  string s, t, a, b;
  cin >> s;
  s += ',';
  bool isNum = true;
  for (char i : s) {
    if (i == ',' || i == ';') {
      if (isNum && t.size() && (t.size() == 1 || t[0] != '0')) {
        a += t + ",";
      } else {
        b += t + ",";
      }
      isNum = true;
      t.clear();
    } else {
      if (i < '0' || i > '9') {
        isNum = false;
      }
      t += i;
    }
  }
  if (a.size()) {
    cout << "\"" << a.substr(0, a.size() - 1) << "\"" << '\n';
  } else {
    cout << '-' << '\n';
  }
  if (b.size()) {
    cout << "\"" << b.substr(0, b.size() - 1) << "\"" << '\n';
  } else {
    cout << '-' << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int tt = 1;
  if (isMult) {
    cin >> tt;
  }
  while (tt--) {
    solve();
  }
  return 0;
}
