#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, a = "\"", b = "\"", temp;
  cin >> s;
  int len = s.length();
  int cur_mode = 0, x = 0;
  bool y = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == ';' || s[i] == ',') {
      temp = s.substr(x, i - x);
      if (temp == "0") cur_mode = 0;
      if (temp == "") cur_mode = 1;
      if (cur_mode == 1) {
        b += temp;
        b += ',';
      } else {
        a += temp;
        a += ',';
      }
      x = i + 1;
      cur_mode = 0;
      y = 0;
    } else {
      if ((s[i] <= 'z' && s[i] >= 'a') || (s[i] <= 'Z' && s[i] >= 'A')) {
        cur_mode = 1;
      }
      if (y == 0) {
        if (s[i] == '0') cur_mode = 1;
        y = 1;
      }
      if (s[i] == '.') cur_mode = 1;
    }
  }
  temp = s.substr(x, len);
  if (temp == "0") cur_mode = 0;
  if (temp == "") cur_mode = 1;
  if (cur_mode == 1) {
    b += temp;
    b += ',';
  } else {
    a += temp;
    a += ',';
  }
  a = a.substr(0, a.length() - 1);
  b = b.substr(0, b.length() - 1);
  a += "\"";
  b += "\"";
  if (a == "\"") a = "-";
  if (b == "\"") b = "-";
  cout << a << endl << b << endl;
}
