#include <bits/stdc++.h>
using namespace std;
bool number(string s) {
  if (s.length() == 0) return false;
  if (s.length() == 1 && s[0] >= '0' && s[0] <= '9') return true;
  for (int i = 0; i < s.length(); ++i) {
    if (!(s[i] >= '0' && s[i] <= '9')) return false;
  }
  if (s[0] == '0') return false;
  return true;
}
int main() {
  string s;
  getline(cin, s);
  string x;
  vector<string> a, b;
  bool choose;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] != 44 && s[i] != 59) {
      x += s[i];
    } else {
      if (number(x))
        a.push_back(x);
      else
        b.push_back(x);
      x = "";
    }
  }
  if (number(x))
    a.push_back(x);
  else
    b.push_back(x);
  if (a.size()) {
    cout << "\"";
    for (int i = 0; i < a.size(); ++i) {
      if (i) cout << "\,";
      cout << a[i];
    }
    cout << "\"\n";
  } else {
    puts("-");
  }
  if (b.size()) {
    cout << "\"";
    for (int i = 0; i < b.size(); ++i) {
      if (i) cout << "\,";
      cout << b[i];
    }
    cout << "\"\n";
  } else {
    puts("-");
  }
}
