#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int getint() {
  int t = 0, flag = 1;
  char c = getchar();
  while (c < '0' || c > '9' || c == '-') {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') t = t * 10 + c - '0', c = getchar();
  return t * flag;
}
int GCD(int m, int n) { return !m ? n : GCD(n % m, m); }
int a[maxn], n, t, m;
int main() {
  string s;
  while (cin >> s) {
    int n = s.size();
    int start = -1;
    int addcnt = 0, i = 0;
    bool alldig = 1;
    string dig = "\"", nodig = "\"";
    for (i = 0; i < n; i++) {
      if (s[i] == ',' || s[i] == ';') {
        string cur =
            (i - start - 1 > 0 ? s.substr(start + 1, i - start - 1) : "");
        if ((cur.size() == 1 || cur.size() > 1 && cur[0] != '0') && alldig) {
          dig += cur + ",";
        } else {
          nodig += cur + ",";
        }
        start = i;
        alldig = 1;
      } else if (!isdigit(s[i])) {
        alldig = 0;
      }
    }
    string cur = (i - start - 1 > 0 ? s.substr(start + 1, i - start - 1) : "");
    if ((cur.size() == 1 || cur.size() > 1 && cur[0] != '0') && alldig) {
      dig += cur + ",";
    } else {
      nodig += cur + ",";
    }
    if (dig.size() > 1)
      dig.back() = '\"';
    else
      dig = "-";
    if (nodig.size() > 1)
      nodig.back() = '\"';
    else
      nodig = "-";
    cout << dig << endl << nodig << endl;
  }
  return 0;
}
