#include <bits/stdc++.h>
using namespace std;
bool isSeparator(char ch) { return (ch == ',' || ch == ' ' || ch == ';'); }
int main() {
  int i, j;
  bool isNumber;
  string s, ss;
  vector<string> words[2];
  cin >> s;
  s += " ";
  ss = "", isNumber = true;
  for (i = 0; i < s.length(); i++) {
    if (isSeparator(s[i])) {
      if (ss.empty() || (isNumber && ss.length() > 1 && ss[0] == '0'))
        isNumber = false;
      words[isNumber].push_back(ss);
      ss = "";
      isNumber = true;
    } else {
      ss += s[i];
      if (!isdigit(s[i])) isNumber = false;
    }
  }
  for (j = 1; j >= 0; j--) {
    if (words[j].size()) {
      cout << "\"";
      for (i = 0; i < words[j].size(); i++) {
        if (i) cout << ",";
        cout << words[j][i];
      }
      cout << "\"" << endl;
    } else
      cout << "-" << endl;
  }
  return 0;
}
