#include <bits/stdc++.h>
using namespace std;
void INeedIT() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
const int N = 1e5 + 5, INF = 1e9 + 7;
string s;
int main() {
  INeedIT();
  cin >> s;
  string a, b, c;
  a = b = c = "";
  bool bl = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ';' || s[i] == ',') {
      if (c.size() == 0) {
        b += ',';
        continue;
      }
      if (bl) b += ',' + c;
      if (!bl) a += ',' + c;
      bl = 0;
      c = "";
      continue;
    }
    if (s[i] < 48 || s[i] > 58 || c[0] == '0') bl = 1;
    c += s[i];
  }
  if (s[s.size() - 1] != ';' || s[s.size() - 1] != ',') {
    if (c.size() == 0) {
      b += ',';
    } else if (bl)
      b += ',' + c;
    else if (!bl)
      a += ',' + c;
  }
  if (a.size()) {
    a.erase(0, 1);
    cout << '"' << a << '"';
  } else
    cout << '-';
  cout << "\n";
  if (b.size()) {
    b.erase(0, 1);
    cout << '"' << b << '"';
  } else
    cout << '-';
}
