#include <bits/stdc++.h>
using namespace std;
const int maxn = 110000;
string str[maxn];
int id1[maxn], id2[maxn];
int main() {
  string S;
  while (cin >> S) {
    string tmp;
    int c = 0;
    for (int i = 0; i < S.size(); i++) {
      if (S[i] == ',' || S[i] == ';') {
        str[c] = tmp;
        c++;
        tmp = "";
        continue;
      }
      tmp += S[i];
    }
    str[c] = tmp;
    c++;
    int p1 = 0, p2 = 0;
    for (int i = 0; i < c; i++) {
      int flag = 0;
      for (int j = 0; j < str[i].size(); j++) {
        if (!(str[i][j] >= '0' && str[i][j] <= '9')) {
          id2[p2] = i;
          p2++;
          flag = 1;
          break;
        }
      }
      if (flag == 0) {
        if (str[i].size() == 0 || (str[i][0] == '0' && str[i].size() != 1)) {
          id2[p2] = i;
          p2++;
        } else {
          id1[p1] = i;
          p1++;
        }
      }
    }
    if (p1 > 0) {
      cout << "\"" << str[id1[0]];
      for (int i = 1; i < p1; i++) {
        cout << "," << str[id1[i]];
      }
      cout << "\"" << endl;
    } else {
      cout << "-" << endl;
    }
    if (p2 > 0) {
      cout << "\"" << str[id2[0]];
      for (int i = 1; i < p2; i++) {
        cout << "," << str[id2[i]];
      }
      cout << "\"" << endl;
    } else {
      cout << "-" << endl;
    }
  }
  return 0;
}
