#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(nullptr);
  char ch;
  bool flag1, flag2, flag, flag3, flag4;
  flag3 = flag4 = false;
  int i, len, cnt = 0, tmp, j;
  string s, tmps, num, str;
  cin >> s;
  len = s.size();
  s += ';', len++;
  num = str = tmps = "";
  flag1 = flag2 = true;
  for (i = 0; i < len; i++) {
    if (s[i] == ';' || s[i] == ',') {
      tmp = tmps.size();
      flag = (tmp) ? true : false;
      if (tmps[0] == '0' && tmp > 1) flag = false;
      if (flag) {
        for (j = 0; j < tmp; j++) {
          ch = tmps[j];
          if ((ch >= 'a' && ch <= 'z') || ch == '.' ||
              (ch >= 'A' && ch <= 'Z')) {
            flag = false;
            break;
          }
        }
      }
      if (flag) {
        if (flag1)
          num += tmps, flag1 = false;
        else
          num += ',', num += tmps;
        flag3 = true;
      } else {
        if (flag2)
          str += tmps, flag2 = false;
        else
          str += ',', str += tmps;
        flag4 = true;
      }
      tmps = "";
      continue;
    }
    tmps += s[i];
  }
  if (flag3)
    cout << '"' << num << '"' << '\n';
  else
    cout << '-' << '\n';
  if (flag4)
    cout << '"' << str << '"' << '\n';
  else
    cout << '-' << '\n';
  return 0;
}
