#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, a, b;
  cin >> s;
  int i = 0;
  while (i < s.length()) {
    bool integer = true;
    int j = i;
    while (s[i] != ',' && s[i] != ';' && i < s.length()) {
      if (j == i) {
        if (s[i] < '1' || s[i] > '9') {
          integer = false;
        }
      } else if (s[i] < '0' || s[i] > '9') {
        integer = false;
      }
      i++;
    }
    i++;
    if (s.substr(j, i - j - 1).length() == 0) {
      b += ",";
    } else if (integer || s.substr(j, i - j - 1) == "0") {
      a += s.substr(j, i - j - 1);
      a += ",";
    } else {
      b += s.substr(j, i - j - 1);
      b += ",";
    }
  }
  if (a.length() == 0) {
    cout << "-"
         << "\n";
  } else {
    a.pop_back();
    cout << "\"" << a << "\"\n";
  }
  if (b.empty()) {
    if (s[s.length() - 1] == ',' || s[s.length() - 1] == ';') {
      cout << "\"\"\n";
    } else {
      cout << "-\n";
    }
  } else {
    if (!(s[s.length() - 1] == ',' || s[s.length() - 1] == ';')) {
      b.pop_back();
    }
    cout << "\"" << b << "\"\n";
  }
  return 0;
}
