#include <bits/stdc++.h>
using namespace std;
char s[100010];
char ans1[100010], ans2[100010];
char tmp[100010];
int main() {
  scanf("%s", &s);
  int l = strlen(s);
  bool num = true;
  int f1 = 0, f2 = 0, fs = 0;
  int k;
  for (int i = 0; i <= l; i++) {
    if (s[i] == ',' || s[i] == ';' || i == l) {
      if (num && (s[fs] != '0' || fs == i - 1) && fs != i) {
        k = 0;
        for (int j = fs; j <= i; j++) {
          ans1[f1 + k] = s[j];
          k++;
        }
        f1 += k;
      } else {
        k = 0;
        for (int j = fs; j <= i; j++) {
          ans2[f2 + k] = s[j];
          k++;
        }
        f2 += k;
      }
      fs = i + 1;
      num = true;
    } else if (s[i] < '0' || s[i] > '9')
      num = false;
  }
  if (f1 == 0)
    printf("-\n");
  else {
    cout << '"';
    for (int i = 0; i < f1 - 1; i++) {
      if (ans1[i] == ';')
        printf(",");
      else
        printf("%c", ans1[i]);
    }
    cout << '"' << endl;
  }
  if (f2 == 0)
    printf("-\n");
  else {
    cout << '"';
    for (int i = 0; i < f2 - 1; i++) {
      if (ans2[i] == ';')
        printf(",");
      else
        printf("%c", ans2[i]);
    }
    cout << '"' << endl;
  }
  return 0;
}
