#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  s += ';';
  string foo, a, b;
  a = b = foo = "";
  for (char c : s) {
    if (c == ',' || c == ';') {
      bool flag = true;
      for (char i : foo) flag &= isdigit(i);
      if (foo == "" || !flag || (foo[0] == '0' && foo.size() > 1))
        b += foo + ",";
      else
        a += foo + ",";
      foo = "";
    } else
      foo += c;
  }
  if (a != "")
    a.pop_back(), cout << '"' << a << '"';
  else
    cout << '-';
  cout << '\n';
  if (b != "")
    b.pop_back(), cout << '"' << b << '"';
  else
    cout << '-';
}
