#include <bits/stdc++.h>
using namespace std;
char s[100006];
int n, last;
vector<string> word, num;
bool check(int l, int r) {
  if (l > r) return 0;
  for (int i = l; i <= r; i++)
    if ('0' > s[i] || s[i] > '9') return 0;
  if (l == r) return 1;
  if (s[l] == '0') return 0;
  return 1;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i <= n; i++) {
    if (i == n || s[i] == ',' || s[i] == ';') {
      if (check(last, i - 1))
        num.push_back(string(s + last, s + i));
      else
        word.push_back(string(s + last, s + i));
      last = i + 1;
    }
  }
  if (num.size()) {
    printf("\"");
    for (int i = 0; i < (int)num.size(); i++) {
      cout << num[i];
      if (i + 1 == (int)num.size())
        printf("\"");
      else
        printf(",");
    }
  } else
    printf("-");
  printf("\n");
  if (word.size()) {
    printf("\"");
    for (int i = 0; i < (int)word.size(); i++) {
      cout << word[i];
      if (i + 1 == (int)word.size())
        printf("\"");
      else
        printf(",");
    }
  } else
    printf("-");
}
