#include <bits/stdc++.h>
using namespace std;
string s;
vector<char> numbs;
vector<char> rest;
int n;
int check(int x, int y) {
  if (x > y) return 0;
  for (int i = x; i <= y; i++)
    if (!('0' <= s[i] && s[i] <= '9')) return 0;
  if (s[x] == '0' && x != y) return 0;
  return 1;
}
int main() {
  getline(cin, s);
  s += ',';
  n = s.size();
  string cur = "";
  int l = 0;
  for (int c = 0; c < n; c++) {
    if (s[c] == ',' || s[c] == ';') {
      if (check(l, c - 1)) {
        for (int o = l; o < c; o++) numbs.push_back(s[o]);
        numbs.push_back(',');
      } else {
        for (int o = l; o < c; o++) rest.push_back(s[o]);
        rest.push_back(',');
      }
      l = c + 1;
    }
  }
  if (numbs.size() > 0) {
    cout << '"';
    for (int i = 0; i < numbs.size() - 1; i++) cout << numbs[i];
    cout << '"' << endl;
  } else
    cout << "-" << endl;
  if (rest.size() > 0) {
    cout << '"';
    for (int i = 0; i < rest.size() - 1; i++) cout << rest[i];
    cout << '"';
  } else
    cout << "-";
  return 0;
}
