#include <bits/stdc++.h>
using namespace std;
const int MOD9 = 1e9 + 7;
const int MOD91 = 1e9 + 9;
const long long MOD12 = 1e12 + 39LL;
const long long MOD15 = 1e15 + 37LL;
const int INF = 1e9;
const int base = 1e9;
const int MAX = 2e5 + 1;
const long double EPS = 1e-10;
string second;
char a[MAX], b[MAX];
int n;
int main() {
  int cnt1 = 0;
  int cnt2 = 0;
  getline(cin, second);
  for (int i = 0; i < second.size(); ++i) {
    if (second[i] == ';') {
      second[i] = ',';
    }
  }
  n = second.size();
  second[n] = ',';
  n++;
  int prev = -1;
  int next = 0;
  while (next < n) {
    while (next < n && second[next] != ',') {
      next++;
    }
    bool leading = true;
    bool first = true;
    for (int i = prev + 1; i < next && leading; ++i) {
      if (i != prev + 1) {
        first = false;
      }
      if (second[i] == '0' && first) {
        leading = false;
      }
      if (!isdigit(second[i])) {
        leading = false;
      }
    }
    if (next - prev - 1 == 1 && second[prev + 1] == '0') {
      leading = true;
    }
    if (next - prev == 1) {
      leading = false;
    }
    if (leading) {
      for (int i = prev + 1; i < next; ++i) {
        a[cnt1++] = second[i];
      }
      a[cnt1++] = ',';
    } else {
      for (int i = prev + 1; i < next; ++i) {
        b[cnt2++] = second[i];
      }
      b[cnt2++] = ',';
    }
    prev = next++;
  }
  if (cnt1) {
    a[cnt1 - 1] = '\0';
    cout << '"' << a << '"' << endl;
  } else {
    cout << "-\n";
  }
  if (cnt2) {
    b[cnt2 - 1] = '\0';
    cout << '"' << b << '"' << endl;
  } else {
    cout << "-\n";
  }
  return 0;
}
