#include <bits/stdc++.h>
using namespace std;
bool check(const string &s) {
  if (s.length() == 0) return false;
  if (s == "0") return true;
  if (s[0] == '0') return false;
  for (char c : s)
    if (!isdigit(c)) return false;
  return true;
}
int main() {
  string s;
  cin >> s;
  s += ';';
  string a, b;
  int fa = 1, fb = 1;
  string ns;
  for (char c : s) {
    if (c == ',' || c == ';') {
      if (check(ns)) {
        if (fa)
          a += ns, fa = 0;
        else
          a += "," + ns;
      } else {
        if (fb)
          b += ns, fb = 0;
        else
          b += "," + ns;
      }
      ns = "";
    } else
      ns += c;
  }
  if (fa)
    cout << "-" << endl;
  else
    cout << "\"" << a << "\"" << endl;
  if (fb)
    cout << "-" << endl;
  else
    cout << "\"" << b << "\"" << endl;
  return 0;
}
