#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<string> v;
  string temp = "";
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == ',' || s[i] == ';') {
      v.push_back(temp);
      temp = "";
    } else {
      temp += s[i];
    }
  }
  string a = "", b = "";
  v.push_back(temp);
  for (int i = 0; i < v.size(); i++) {
    int flag = 0;
    for (int j = 0; j < v[i].size(); j++) {
      if (isdigit(v[i][j]))
        continue;
      else {
        flag = 1;
        break;
      }
    }
    if (flag == 1 || (v[i][0] == '0' && v[i].size() > 1) || v[i] == "")
      b += v[i] + ",";
    else
      a += v[i] + ",";
  }
  a.size() > 0 ? cout << "\"" << a.substr(0, a.length() - 1) << "\"" << endl
               : cout << "-" << endl;
  b.size() > 0 ? cout << "\"" << b.substr(0, b.length() - 1) << "\"" << endl
               : cout << "-" << endl;
}
