#include <bits/stdc++.h>
using namespace std;
vector<string> vec;
vector<string> s1, s2;
bool isNum(string s) {
  if (s.length() == 0) return false;
  if (s[0] == '0') {
    if (s.size() == 1) return true;
    return false;
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] > '9' || s[i] < '0') return false;
  }
  return true;
}
void print(vector<string> s) {
  if (s.size() == 0)
    cout << "-" << endl;
  else {
    cout << "\"";
    for (int i = 0; i < s.size(); i++) {
      if (i > 0) cout << ",";
      cout << s[i];
    }
    cout << "\"" << endl;
  }
}
int main() {
  string s;
  while (cin >> s) {
    vec.clear();
    s1.clear();
    s2.clear();
    int st = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == ',' || s[i] == ';') {
        vec.push_back(s.substr(st, i - st));
        st = i + 1;
      }
    }
    if (st < s.length()) vec.push_back(s.substr(st, s.length() - st));
    if (s[s.length() - 1] == ',' || s[s.length() - 1] == ';') vec.push_back("");
    for (int i = 0; i < vec.size(); i++) {
      if (isNum(vec[i]))
        s1.push_back(vec[i]);
      else
        s2.push_back(vec[i]);
    }
    print(s1);
    print(s2);
  }
  return 0;
}
