#include <bits/stdc++.h>
using namespace std;
int isint(string s) {
  if (s == "") return 0;
  if (s[0] == '0') {
    if (s == "0")
      return 1;
    else
      return 0;
  }
  for (int i = 0; i < s.length(); i++) {
    if (!isdigit(s[i])) return 0;
  }
  return 1;
}
int main() {
  string s;
  cin >> s;
  vector<string> ints;
  vector<string> nonints;
  string tmp = "";
  for (int i = 0; i < s.length(); i++) {
    if (i == s.length() - 1) {
      if (s[i] == ',' || s[i] == ';') {
        if (isint(tmp)) {
          ints.push_back(tmp);
        } else {
          nonints.push_back(tmp);
        }
        nonints.push_back("");
        break;
      } else {
        tmp += s[s.length() - 1];
        if (isint(tmp))
          ints.push_back(tmp);
        else
          nonints.push_back(tmp);
        break;
      }
    }
    if (s[i] == ',' || s[i] == ';') {
      if (isint(tmp))
        ints.push_back(tmp);
      else
        nonints.push_back(tmp);
      tmp = "";
    } else {
      tmp += s[i];
    }
  }
  if (ints.size() == 0) {
    cout << "-" << endl;
  } else {
    cout << "\"";
    for (int i = 0; i < ints.size() - 1; i++) {
      cout << ints[i] << ",";
    }
    cout << ints[ints.size() - 1] << "\"" << endl;
  }
  if (nonints.size() == 0) {
    cout << "-" << endl;
  } else {
    cout << "\"";
    for (int i = 0; i < nonints.size() - 1; i++) {
      cout << nonints[i] << ",";
    }
    cout << nonints[nonints.size() - 1] << "\"" << endl;
  }
  return 0;
}
