#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, a = "", b = "", sub = "";
  int len, l = -1, r = 0, k, ia = 0, ib = 0;
  bool isInt;
  cin >> s;
  r = min(s.find_first_of(',', l + 1), s.find_first_of(';', l + 1));
  while (true) {
    isInt = false;
    if (r == -1)
      sub = s.substr(l + 1);
    else
      sub = s.substr(l + 1, r - l - 1);
    if (sub[0] == '0' && sub.length() == 1)
      isInt = true;
    else if (sub[0] == '0' && sub.length() > 1)
      isInt = false;
    else {
      for (int i = 0; i < sub.length(); i++) {
        if (!(sub[i] >= '0' && sub[i] <= '9')) {
          isInt = false;
          break;
        } else
          isInt = true;
      }
    }
    if (isInt && ia)
      a += ',';
    else if (!isInt && ib)
      b += ',';
    if (isInt) {
      a += sub;
      ia = 1;
    } else {
      b += sub;
      ib = 1;
    }
    if (r == -1) break;
    l = r;
    r = min(s.find_first_of(',', l + 1), s.find_first_of(';', l + 1));
  }
  if (ia && ib) {
    cout << "\"" << a << "\"" << endl;
    cout << "\"" << b << "\"";
  } else if (ia) {
    cout << "\"" << a << "\"" << endl;
    cout << "-";
  } else if (ib) {
    cout << "-" << endl;
    cout << "\"" << b << "\"";
  } else {
    cout << "-" << endl;
    cout << "-";
  }
  return 0;
}
