#include <bits/stdc++.h>
using namespace std;
bool isdig(string s) {
  for (char ch : s) {
    if (!isdigit(ch)) return false;
  }
  return true;
}
int main() {
  vector<string> svtr(1, "");
  for (;;) {
    char ch = getchar();
    if (ch == '\n')
      break;
    else if (ch == ',' || ch == ';')
      svtr.push_back(string(""));
    else
      svtr[svtr.size() - 1] = svtr[svtr.size() - 1] + ch;
  }
  vector<string> snum, selse;
  for (string& s : svtr) {
    if ((s[0] != '0' && s[0] != '\0' && isdig(s)) ||
        (s[0] == '0' && s[1] == '\0'))
      snum.push_back(s);
    else
      selse.push_back(s);
  }
  if (snum.empty()) {
    cout << '-' << endl;
  } else {
    cout << '\"';
    for (int i = 0; i != snum.size(); i++) {
      cout << snum[i] << (i == snum.size() - 1 ? '\"' : ',');
    }
    cout << endl;
  }
  if (selse.empty()) {
    cout << '-';
  } else {
    cout << '\"';
    for (int i = 0; i != selse.size(); i++) {
      cout << selse[i] << (i == selse.size() - 1 ? '\"' : ',');
    }
  }
  cout << endl;
  return 0;
}
