#include <bits/stdc++.h>
using namespace std;
bool isInteger(string word) {
  if (word.size() == 0) return false;
  if (word[0] == '0' && word.size() > 1) return false;
  for (int i = 0; i < (word.size()); i++) {
    if (word[i] == '.' || (word[i] >= 'a' && word[i] <= 'z') ||
        (word[i] >= 'A' && word[i] <= 'Z'))
      return false;
  }
  return true;
}
void printWord(vector<string> &a) {
  if (a.size() == 0) {
    cout << "-" << endl;
    return;
  }
  cout << "\"";
  for (int i = 0; i < (a.size()); i++) {
    if (i != a.size() - 1)
      cout << a[i] << ",";
    else
      cout << a[i];
  }
  cout << "\"" << endl;
}
int main() {
  string str, word;
  vector<string> a, b;
  cin >> str;
  word = "";
  for (int i = 0; i < (str.size()); i++) {
    if (str[i] == ';' || str[i] == ',') {
      if (isInteger(word)) {
        a.push_back(word);
      } else {
        b.push_back(word);
      }
      word = "";
    } else
      word += str[i];
  }
  if (word.size() > 0 && isInteger(word))
    a.push_back(word);
  else
    b.push_back(word);
  printWord(a);
  printWord(b);
  return 0;
}
