#include <bits/stdc++.h>
using namespace std;
string s;
string a = "", b = "", c = "", num1, num2;
int len;
int check(string &w) {
  if (w == "") return 2;
  int wlen = w.size(), flag1 = 0, flag2 = 0, flag3 = 1;
  if (w[0] == '0') {
    if (w.size() == 1)
      return 1;
    else
      return 2;
  }
  for (int i = 0; i < wlen; i++) {
    if (w[i] >= 'a' && w[i] <= 'z' || w[i] >= 'A' && w[i] <= 'Z' ||
        w[i] == '.') {
      return 2;
    }
  }
  return 1;
}
vector<string> v[2];
int main() {
  cin >> s;
  s += ',';
  int len = s.size(), flag0 = 0, flag1 = 0;
  if (len == 1) {
    if (s[0] == ',' || s[0] == ';')
      cout << "-" << endl << "-" << endl;
    else if (s[0] >= '0' && s[0] <= '9')
      cout << "\"" << s[0] << "\"" << endl << "-" << endl;
    else
      cout << "-" << endl << "\"" << s[0] << "\"" << endl;
  } else {
    for (int i = 0; i < len; i++) {
      c = "";
      for (int j = i; j < len; j++) {
        if (s[j] != ',' && s[j] != ';') {
          c += s[j];
        } else {
          int num = check(c);
          if (num == 1) {
            flag0 = 1;
            v[0].push_back(c);
          }
          if (num == 2 || num == 0) {
            flag1 = 1;
            v[1].push_back(c);
          }
          i = j;
          break;
        }
      }
    }
    int len1 = v[0].size(), len2 = v[1].size();
    if (!flag0)
      puts("-");
    else {
      cout << "\"";
      for (int i = 0; i < len1; i++) {
        cout << v[0][i];
        if (i != len1 - 1) cout << ",";
      }
      cout << "\"" << endl;
    }
    if (!flag1)
      puts("-");
    else {
      cout << "\"";
      for (int i = 0; i < len2; i++) {
        cout << v[1][i];
        if (i != len2 - 1) cout << ",";
      }
      cout << "\"" << endl;
    }
  }
  return 0;
}
