#include <bits/stdc++.h>
using namespace std;
string s, a = "", b = "", t = "";
bool f = 1;
int main() {
  cin >> s;
  for (int i = 0; i <= s.length(); i++) {
    if ((s[i] == ';') || (s[i] == ',') || (i == s.length())) {
      if (t.length() == 0) f = 0;
      if ((t.length() > 1) && (t[0] == '0')) f = 0;
      t += ",";
      if (f) {
        a += t;
      } else {
        b += t;
      }
      t = "";
      f = 1;
    } else {
      t += s[i];
      if ((s[i] < '0') || (s[i] > '9')) f = 0;
    }
  }
  if (a.length() > 0) {
    a = '"' + a;
    a[a.length() - 1] = '"';
  } else {
    a = "-";
  }
  if (b.length() > 0) {
    b = '"' + b;
    b[b.length() - 1] = '"';
  } else {
    b = "-";
  }
  cout << a << endl << b;
  return 0;
}
