#include <bits/stdc++.h>
using namespace std;
string a, b;
bool ok(string s) {
  if (s == "") return false;
  if (s.length() == 1 && s[0] == '0') return true;
  if (s[0] == '0') return false;
  for (char c : s) {
    if (c < '0' || c > '9') return false;
  }
  return true;
}
void cal(string s) {
  if (ok(s))
    a += s + ",";
  else
    b += s + ",";
}
void go(string &ret) {
  if (ret == "")
    ret = "-";
  else {
    ret = "\"" + ret;
    ret[ret.length() - 1] = '"';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s, t = "";
  cin >> s;
  for (char c : s) {
    if (c == ',' || c == ';') {
      cal(t);
      t = "";
    } else {
      t += c;
    }
  }
  cal(t);
  go(a);
  go(b);
  cout << a << '\n' << b;
  return 0;
}
