#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s, a = "", b = "";
  cin >> s;
  s += ";";
  string tmpstr = "";
  bool type = false;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == ';' || s[i] == ',') {
      if (tmpstr.length() == 1 && tmpstr[0] == '0')
        type = true;
      else if (tmpstr[0] == '0')
        type = false;
      if (type)
        a += tmpstr + ",";
      else
        b += tmpstr + ",";
      tmpstr = "";
      type = false;
    } else {
      type = true;
      while (i < s.length() && s[i] != ';' && s[i] != ',') {
        if (!isdigit(s[i])) {
          type = false;
        }
        tmpstr += s[i];
        i++;
      }
      i--;
    }
  }
  if (a.length() == 0)
    a = "-";
  else
    a = "\"" + a.substr(0, a.length() - 1) + "\"";
  if (b.length() == 0)
    b = "-";
  else
    b = "\"" + b.substr(0, b.length() - 1) + "\"";
  cout << a << "\n";
  cout << b << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
