#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c, s, d;
  int n, i;
  int flag = 1;
  cin >> s;
  s += ';';
  for (i = 0; i < s.length(); i++) {
    if (s[i] == ';' || s[i] == ',') {
      if (c == "" || c.size() > 1 && c[0] == '0') flag = 0;
      if (flag == 1)
        a += c + ',';
      else
        b += c + ',';
      c = "";
      flag = 1;
    } else {
      c += s[i];
      if (!(s[i] >= '0' && s[i] <= '9')) flag = 0;
    }
  }
  if (a != "") {
    a.erase(--a.end());
    cout << "\"" << a << "\"" << endl;
  } else
    cout << "-" << endl;
  if (b != "") {
    b.erase(--b.end());
    cout << "\"" << b << "\"" << endl;
  } else
    cout << "-" << endl;
  return 0;
}
