You are given string s. Let's call word any largest sequence of consecutive symbols without symbols ',' (comma) and ';' (semicolon). For example, there are four words in string "aba,123;1a;0": "aba", "123", "1a", "0". A word can be empty: for example, the string s=";;" contains three empty words separated by ';'.

You should find all words in the given string that are nonnegative INTEGER numbers without leading zeroes and build by them new string a. String a should contain all words that are numbers separating them by ',' (the order of numbers should remain the same as in the string s). By all other words you should build string b in the same way (the order of numbers should remain the same as in the string s).

Here strings "101", "0" are INTEGER numbers, but "01" and "1.0" are not.

For example, for the string aba,123;1a;0 the string a would be equal to "123,0" and string b would be equal to "aba,1a".


-----Input-----

The only line of input contains the string s (1 ≤ |s| ≤ 10^5). The string contains only symbols '.' (ASCII 46), ',' (ASCII 44), ';' (ASCII 59), digits, lowercase and uppercase latin letters.


-----Output-----

Print the string a to the first line and string b to the second line. Each string should be surrounded by quotes (ASCII 34).

If there are no words that are numbers print dash (ASCII 45) on the first line. If all words are numbers print dash on the second line.


-----Examples-----
Input
aba,123;1a;0

Output
"123,0"
"aba,1a"

Input
1;;01,a0,

Output
"1"
",01,a0,"

Input
1

Output
"1"
-

Input
a

Output
-
"a"



-----Note-----

In the second example the string s contains five words: "1", "", "01", "a0", "".

Difficulty: MEDIUM_HARD

Solutions:
def is_int(x):
	if len(x) <= 0:
		return False
	return x == '0' or (all((c in '0123456789' for c in x)) and x[0] != '0')

def main():
	s = input()
	cur = []
	words = []
	for c in s:
		if c == ',' or c == ';':
			words.append(''.join(cur))
			cur = []
		else:
			cur.append(c)
	words.append(''.join(cur))
	a = []
	b = []
	for w in words:
		if is_int(w):
			a.append(w)
		else:
			b.append(w)
	if a:
		print('"{}"'.format(','.join(a)))
	else:
		print('-')
	if b:
		print('"{}"'.format(','.join(b)))
	else:
		print('-')
main()


import re
s = input()
s = re.split(',|;', s)
a = []
b = []
for i in s:
	try:
		if str(int(i)) == i:
			a.append(i)
		else:
			b.append(i)
	except ValueError:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"{}'.format(a[0]), end='')
	for i in a[1:]:
		print(',{}'.format(i), end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"{}'.format(b[0]), end='')
	for i in b[1:]:
		print(',{}'.format(i), end='')
	print('"')


inp = input()
inp = inp.replace(',', ';')
tokens = inp.split(';')
a = []
b = []
for token in tokens:
	if token.isdigit() and token[0] != '0' or token == '0':
		a.append(token)
	else:
		b.append(token)
if len(a) is 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) is 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
s = input()
t = re.split('[,;]', s)
a = [ti for ti in t if re.fullmatch('0|[1-9]\\d*', ti)]
b = [ti for ti in t if not re.fullmatch('0|[1-9]\\d*', ti)]
print('"' + ','.join(a) + '"' if a else '-')
print('"' + ','.join(b) + '"' if b else '-')


a = input()
words = a.replace(',', ';').split(';')
numbers = []
strings = []
for word in words:
	if not word:
		strings.append(word)
	elif (word[0] == '0') & (len(word) >= 2):
		strings.append(word)
	elif word.isnumeric():
		numbers.append(word)
	else:
		strings.append(word)
if not numbers:
	print('-')
	print('"', ','.join(strings), '"', sep='')
elif not strings:
	print('"', ','.join(numbers), '"', sep='')
	print('-')
else:
	print('"', ','.join(numbers), '"', sep='')
	print('"', ','.join(strings), '"', sep='')


n = input().split(';')
s = [y for x in n for y in x.split(',')]
numbers = []
strings = []
for i in range(len(s)):
	isNumber = True
	isString = True
	if s[i] == '' or (s[i][0] == '0' and len(s[i]) > 1):
		isNumber = False
	for j in range(len(s[i])):
		if not '0' <= s[i][j] <= '9':
			isNumber = False
	if isNumber:
		numbers.append(s[i])
	else:
		strings.append(s[i])
if numbers == []:
	print('-')
else:
	print('"', ','.join(numbers), '"', sep='')
if strings == []:
	print('-')
else:
	print('"', ','.join(strings), '"', sep='')


import sys
s = input()
z = []
pp = ''
for i in s:
	if i == ';' or i == ',':
		z.append(pp)
		pp = ''
	else:
		pp += i
if s[-1] == ';' or s[-1] == ',':
	z.append('')
else:
	z.append(pp)
numb = []
words = []
for i in z:
	flag = 1
	for j in i:
		if '0' <= j <= '9':
			pass
		else:
			flag = 0
			break
	if flag == 0 or i == '' or (i != '0' and i[0] == '0'):
		words.append(i)
	else:
		numb.append(i)
if numb:
	print('"', end='')
	print(*numb, sep=',', end='')
	print('"')
else:
	print('-')
if words:
	print('"', end='')
	print(*words, sep=',', end='')
	print('"')
else:
	print('-')


import re
S = re.split('[,;]', input())
A = []
B = []
for s in S:
	if s.isdecimal() and (not (s[0] == '0' and len(s) > 1)):
		A.append(s)
	else:
		B.append(s)
print('"' + ','.join(A) + '"' if A else '-')
print('"' + ','.join(B) + '"' if B else '-')


l = input()
e = l.split(',')
for i in range(len(e)):
	e[i] = e[i].split(';')
M = []
M2 = []
for i in e:
	for j in i:
		if j.isnumeric() and (not (len(j) > 1 and j[0] == '0')):
			M.append(j)
		else:
			M2.append(j)
ans = '"'
for i in M:
	ans += i + ','
ans = ans[:-1] + '"'
if len(M) == 0:
	print('-')
else:
	print(ans)
ans = ''
ans += '"'
for i in M2:
	ans += i + ','
ans = ans[:-1] + '"'
if len(M2) == 0:
	print('-')
else:
	print(ans)


s = input()
s = s.replace(';', ',').split(',')
ints = []
other = []
for f in s:
	if f.isdigit() and str(int(f)) == f:
		ints.append(f)
	else:
		other.append(f)
if not ints:
	print('-')
else:
	print('"{}"'.format(str.join(',', ints)))
if not other:
	print('-')
else:
	print('"{}"'.format(str.join(',', other)))


s = input()
f = ''
num = 0
(a, b) = ([], [])
for i in range(len(s)):
	if s[i] in ',;' and (num == 2 or num == 0):
		b.append(f)
		f = ''
		num = 0
	elif s[i] in ',;' and num == 1:
		a.append(f)
		f = ''
		num = 0
	elif s[i] in '123456789' and (num == 0 or num == 1):
		num = 1
		f += s[i]
	elif s[i] in '0123456789' and (f or (s[i] != s[-1] and s[i + 1] in ',;') or i == len(s) - 1) and (num == 0 or num == 1):
		f += s[i]
		num = 1
	else:
		f += s[i]
		num = 2
if num == 2 or num == 0:
	b.append(f)
else:
	a.append(f)
if a:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(b) + '"')
else:
	print('-')


import re

def solve(s):

	def is_int(w):
		return w and all((c.isdigit() for c in w)) and (str(int(w)) == w)
	words = re.split('[,;]', s)
	ints = [w for w in words if is_int(w)]
	rest = [w for w in words if not is_int(w)]
	if not ints:
		ints = None
	if not rest:
		rest = None
	return (ints, rest)

def main():
	s = input().strip()
	results = solve(s)
	for res in results:
		if res is None:
			print('-')
		else:
			print('"%s"' % ','.join(res))
main()


import re

def is_int(s):
	if len(s) == 0:
		return False
	if s == '0':
		return True
	num = False
	for c in s:
		if c is '0' and (not num):
			return False
		elif ord(c) < ord('0') or ord(c) > ord('9'):
			return False
		else:
			num = True
	return True
string = input()
ans = re.split(';|,', string)
ansi = []
anss = []
for a in ans:
	if is_int(a):
		ansi.append(a)
	else:
		anss.append(a)
if len(ansi):
	print('"', end='')
	print(','.join(ansi), end='')
	print('"')
else:
	print('-')
if len(anss):
	print('"', end='')
	print(','.join(anss), end='')
	print('"')
else:
	print('-')


s = input()
cur = ''
num_s = ''
anum_s = ''
num = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}

def isnumber(cur):
	if cur == '':
		return False
	if cur[0] == '0':
		if len(cur) == 1:
			return True
		else:
			return False
	for i in range(len(cur)):
		if not cur[i] in num:
			return False
	return True
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		if isnumber(cur):
			num_s += ',' + cur
		else:
			anum_s += ',' + cur
		cur = ''
	else:
		cur += s[i]
if isnumber(cur):
	num_s += ',' + cur
else:
	anum_s += ',' + cur
if num_s == '':
	print('-')
else:
	print('"', num_s[1:len(num_s)], '"', sep='')
if anum_s == '':
	print('-')
else:
	print('"', anum_s[1:len(anum_s)], '"', sep='')


s = input().replace(';', ',').split(',')
a = []
b = []
for w in s:
	if w.isdigit() and (w == '0' or w[0] != '0'):
		a.append(w)
	else:
		b.append(w)
for v in (a, b):
	print('"{}"'.format(','.join(v)) if v else '-')


words = input().replace(';', ',').split(',')
ints = [word for word in words if word.isdigit() and (word[0] != '0' or len(word) == 1)]
non_ints = [i for i in words if i not in ints]
print('"' + ','.join(ints) + '"' if len(ints) != 0 else '-')
print('"' + ','.join(non_ints) + '"' if len(non_ints) else '-')


s = input()
L = [r for d in s.split(',') for r in d.split(';') if len(r) > 0 and r.isdigit() and (r[0] != '0') or r == '0']
SL = set(L)
s1 = ','.join(L)
print('"' + s1 + '"' if s1 != '' else '-')
LL = [r for d in s.split(',') for r in d.split(';') if not r in SL]
s2 = ','.join(LL)
print('"' + s2 + '"' if len(LL) > 0 else '-')


import sys
import re
input = sys.stdin.readline
s = re.split('[,;]', input().rstrip())
l = list('0123456789')
a = []
b = []
for t in s:
	if len(t) == 0:
		b.append(t)
	elif len(t) >= 2 and t[0] == '0':
		b.append(t)
	else:
		for j in range(len(t)):
			if not t[j] in l:
				b.append(t)
				break
		else:
			a.append(t)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


s = input()
a1 = s.split(';')
b1 = []
for i in range(len(a1)):
	b1 += a1[i].split(',')
a = ''
b = ''
for x in b1:
	if x.isdigit():
		if x[0] == '0' and len(x) > 1:
			b += ',' + x
		else:
			a += ',' + x
	else:
		b += ',' + x
if len(a) == 0:
	a = '-'
else:
	a = '"' + a[1:]
	a += '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + b[1:]
	b += '"'
print(a, b, sep='\n')


import sys
s = input()
a = ''
b = ''
cur = ''
first_a = True
first_b = True

def integer(str):
	if str == '':
		return False
	if str == '0':
		return True
	if str.isdigit() and (not str.startswith('0')):
		return True
	return False

def process(cur, a, b, first_a, first_b):
	if integer(cur):
		if not first_a:
			a += ','
		a += str(cur)
		first_a = False
	else:
		if not first_b:
			b += ','
		b += str(cur)
		first_b = False
	return (a, b, first_a, first_b)
for c in s:
	if c == ',' or c == ';':
		(a, b, first_a, first_b) = process(cur, a, b, first_a, first_b)
		cur = ''
	else:
		cur += str(c)
(a, b, first_a, first_b) = process(cur, a, b, first_a, first_b)
print('"' + a + '"' if a != '' or not first_a else '-')
print('"' + b + '"' if b != '' or not first_b else '-')


s1 = input()
s1 = s1.replace(';', ' ')
s1 = s1.replace(',', ' ')
s = s1.split(' ')
a = []
b = []
for i in s:
	if i.isdigit() and i[0] != '0' or i == '0':
		a.append(i)
	else:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
s = re.split(',|;', input())
pattern = '([1-9][0-9]*)|(0)'
regex = re.compile(pattern)
a = []
b = []
for i in s:
	m = regex.match(i)
	if len(i) == 0 or m == None or i[m.start():m.end()] != i:
		b.append(i)
	else:
		a.append(i)
if len(a) == 0:
	a = '-'
else:
	a = '"' + ','.join(a) + '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + ','.join(b) + '"'
print(a)
print(b)


import sys
input = sys.stdin.readline
number = []
word = []
temp = []
period = 0
bad = 0
for i in input().strip() + ',':
	if i in ',;':
		if period or bad:
			word.append(''.join(temp))
		elif len(temp) == 0:
			word.append('')
		elif temp[0] == '0':
			if len(temp) == 1 or temp[1] == '.':
				number.append(''.join(temp))
			else:
				word.append(''.join(temp))
		else:
			number.append(''.join(temp))
		temp = []
		period = 0
		bad = 0
	else:
		if i == '.':
			period += 1
		elif i not in '.0123456789':
			bad += 1
		temp.append(i)
if len(number):
	print('"%s"' % ','.join(number))
else:
	print('-')
if len(word):
	print('"%s"' % ','.join(word))
else:
	print('-')


def main():
	nw = ([], [])
	for s in input().replace(';', ',').split(','):
		nw[s.isdigit() and (s[0] != '0' or s == '0')].append(s)
	for l in nw[::-1]:
		print('"%s"' % ','.join(l) if l else '-')
main()


(a, b) = ([], [])
for w in input().replace(';', ',').split(','):
	if str.isdigit(w) and (len(w) == 1 or w[0] != '0'):
		a.append(w)
	else:
		b.append(w)
for l in (a, b):
	print('"' + ','.join(l) + '"' if l else '-')


def isgood(s):
	if s == '0':
		return True
	if s.isdigit() and s[0] != '0':
		return True
	return False

def fun():
	s = input()
	a_list = []
	b_list = []
	items = [item.split(',') for item in s.split(';')]
	for item in items:
		if not isinstance(item, list):
			if isgood(item):
				a_list.append(item)
			else:
				b_list.append(item)
		else:
			for word in item:
				if isgood(word):
					a_list.append(word)
				else:
					b_list.append(word)
	if len(a_list) == 0:
		a = '-'
	else:
		a = ','.join(a_list)
	if len(b_list) == 0:
		b = '-'
	else:
		b = ','.join(b_list)
	if a != '-':
		a = '"' + a + '"'
	if b != '-':
		b = '"' + b + '"'
	print(a)
	print(b)
fun()


a = input()
a = a.replace(';', ',').split(',')
b = []
c = []
for str in a:
	if str.isdigit() and (str[0] != '0' or str == '0'):
		b.append(str)
	else:
		c.append(str)
s = '"'
if len(b) > 0:
	for i in b:
		s = s + i + ','
	s = s[:-1] + '"'
	print(s)
else:
	print('-')
s = '"'
if len(c) > 0:
	for i in c:
		s = s + i + ','
	s = s[:-1] + '"'
	print(s)
else:
	print('-')


import re
x = input()
array = []
array2 = []
for i in re.split(',|;', x):
	if i == '0':
		array.append(i)
	elif i.isdigit() and i[0] != '0':
		array.append(i)
	else:
		array2.append(i)
	x = ''
	y = ''
if not array:
	print('-')
else:
	for i in range(len(array)):
		if i == len(array) - 1:
			y += array[i]
		else:
			y += array[i] + ','
	print('"{}"'.format(y))
if not array2:
	print('-')
else:
	for i in range(len(array2)):
		if i == len(array2) - 1:
			x += array2[i]
		else:
			x += array2[i] + ','
	print('"{}"'.format(x))


import re
s = input()
res = re.split(',|;', s)
first = ''
sec = ''
for i in res:
	if re.search('[a-zA-Z]', i):
		sec += i + ','
	elif re.search('\\.', i):
		sec += i + ','
	elif len(i) == 0:
		sec += ','
	if i.isdecimal():
		if len(i) > 1 and i[0] == '0':
			sec += i + ','
		else:
			first += i + ','
first = first[:-1]
sec = sec[:-1]
first = '"' + first + '"'
sec = '"' + sec + '"'
print(first if first != '""' else '-')
print(sec if sec != '""' or res[-1] == '' or res[0] == '' else '-')


import re

def isInteger(s, p):
	if p.match(s):
		return True
	return False
s = input().strip()
a = []
b = []
integerRE = re.compile('((\\d)|([1-9](\\d+)))$')
words = s.split(sep=',')
for awords in words:
	awords = awords.split(sep=';')
	for word in awords:
		if isInteger(word, integerRE):
			a.append(word)
		else:
			b.append(word)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


s = input() + ';'
a = ''
b = ''
tmp = ''
for i in range(len(s)):
	if ord(s[i]) != 44 and ord(s[i]) != 59:
		tmp = tmp + s[i]
	elif len(tmp) != 0:
		k = 1
		if tmp[0] == '0' and len(tmp) != 1:
			b += tmp + ','
		else:
			for j in range(0, len(tmp)):
				if ord(tmp[j]) < 48 or ord(tmp[j]) > 57:
					k = 0
					break
			if k == 1:
				a += tmp + ','
			else:
				b += tmp + ','
		tmp = ''
	else:
		b += ','
if len(a) != 0:
	print('"' + a[:len(a) - 1] + '"')
else:
	print('-')
if len(b) != 0:
	print('"' + b[:len(b) - 1] + '"')
else:
	print('-')


import re
a = []
b = []
for x in re.split(',|;', input()):
	if x == '0':
		a.append(x)
	elif x and x[0] != '0' and x.isdigit():
		a.append(x)
	else:
		b.append(x)
if not a:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if not b:
	print('-')
else:
	print('"' + ','.join(b) + '"')


a = input()
a = a.split(';')
for i in range(len(a)):
	a[i] = a[i].split(',')
ints = []
nonints = []
for i in a:
	for j in i:
		try:
			if j.isdigit() and j[0] != '0':
				ints.append(j)
			elif j == '0':
				ints.append(j)
			else:
				nonints.append(j)
		except ValueError:
			nonints.append(j)
b = ''
for i in ints:
	b += i + ','
b = b[:-1]
c = ''
for i in nonints:
	c += i + ','
c = c[:-1]
if b != '' and len(nonints) != 0:
	print('"' + b + '"' + '\n' + '"' + c + '"')
elif b == '' and len(nonints) != 0:
	print('-' + '\n' + '"' + c + '"')
elif b != '' and len(nonints) == 0:
	print('"' + b + '"' + '\n' + '-')
else:
	print('-\n-')


import sys
SEPARATORS = set([',', ';'])

def is_zero(word):
	return len(word) == 1 and word[0] == '0'

def add_word(word, numbers, others, is_number):
	if not is_zero(word) and (len(word) == 0 or not is_number):
		others.append(word)
	else:
		numbers.append(word)

def solve(line):
	(numbers, others) = ([], [])
	(word, is_number) = ([], True)
	for char in line:
		if char in SEPARATORS:
			add_word(word, numbers, others, is_number)
			(word, is_number) = ([], True)
		else:
			if not char.isdigit() or (char == '0' and len(word) == 0):
				is_number = False
			word.append(char)
	add_word(word, numbers, others, is_number)
	return (numbers, others)
assert solve('aba,123;1a;0') == ([list('123'), list('0')], [list('aba'), list('1a')])
assert solve('1;;01,a0,') == ([['1']], [[], list('01'), list('a0'), []])
assert solve('1') == ([['1']], [])
assert solve('a') == ([], [['a']])

def format_result(result):
	if len(result) == 0:
		return '-'
	return '"{}"'.format(','.join(map(lambda word: ''.join(word), result)))
(numbers, others) = map(format_result, solve(input().strip()))
print('{}\n{}'.format(numbers, others))


x = input()
p = x.split(',')
l = []
for i in p:
	r = i.split(';')
	for j in r:
		l.append(j)
alpha = ''
num = ''
for i in l:
	f = False
	if len(i) == 0:
		f = True
	k = i[:-len(i) + 1]
	if k == '0':
		f = True
	for j in i:
		if j < '0' or j > '9':
			f = True
			break
	if f:
		alpha += i
		alpha += str(',')
	else:
		num += i
		num += str(',')
if len(alpha) == 0:
	alpha = '-'
else:
	alpha = alpha[:-1]
	alpha = str('"') + alpha + str('"')
if len(num) == 0:
	num = '-'
else:
	num = num[:-1]
	num = str('"') + num + str('"')
print(num)
print(alpha)


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
import re

def main():
	pattern = re.compile(';|,')
	words = pattern.split(input())
	first = list()
	second = list()
	for v in words:
		if v.isdigit() and len(str(int(v))) == len(v):
			first.append(v)
		else:
			second.append(v)
	if len(first) != 0:
		print('"' + ','.join(first) + '"')
	else:
		print('-')
	if len(second) != 0:
		print('"' + ','.join(second) + '"')
	else:
		print('-')
main()


strings = input().replace(';', ',').split(',')
inteiros = []
nao_inteiros = []
for word in strings:
	if word.isdigit() and (word == '0' or word[0] != '0'):
		inteiros.append(word)
	else:
		nao_inteiros.append(word)
for i in (inteiros, nao_inteiros):
	print('"{}"'.format(','.join(i)) if i else '-')


s = input()
i = 0
tokens = []
while i < len(s):
	j = i
	while j < len(s) and s[j] not in ',;':
		j += 1
	tokens.append(s[i:j])
	i = j + 1
if s[-1] in ',;':
	tokens.append('')
numbers = []
nonnumbers = []
for t in tokens:
	if len(t) > 0 and all((c in '0123456789' for c in t)) and (not (len(t) > 1 and t[0] == '0')):
		numbers.append(t)
	else:
		nonnumbers.append(t)
print('"' + ','.join(numbers) + '"' if numbers else '-')
print('"' + ','.join(nonnumbers) + '"' if nonnumbers else '-')


S = input().replace(',', ';').split(';')
(notint, isint) = ([], [])
for w in S:
	if w.isdigit() and w[0] != '0' or w == '0':
		isint.append(w)
	else:
		notint.append(w)
if len(isint) == 0:
	print('-')
else:
	print('"' + ','.join(isint) + '"')
if len(notint) == 0:
	print('-')
else:
	print('"' + ','.join(notint) + '"')


import re
s = input()
words = re.split('[;,]', s)
(a, b) = ([], [])
for w in words:
	if w.isdigit() and (not (w[0] == '0' and len(w) > 1)):
		a.append(w)
	else:
		b.append(w)
print('"' + ','.join(a) + '"' if a else '-')
print('"' + ','.join(b) + '"' if b else '-')


from functools import cmp_to_key
from collections import deque, Counter
from heapq import heappush, heappop
from math import log, ceil
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def ii():
	return int(inp())

def si():
	return str(inp())

def li(lag=0):
	l = list(map(int, inp().split()))
	if lag != 0:
		for i in range(len(l)):
			l[i] += lag
	return l

def mi(lag=0):
	matrix = list()
	for i in range(n):
		matrix.append(li(lag))
	return matrix

def lsi():
	return list(map(str, inp().split()))

def print_list(lista, space=' '):
	print(space.join(map(str, lista)))

def bisect_left(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] < x:
			left = mid + 1
		else:
			right = mid
	return left

def bisect_right(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] > x:
			right = mid
		else:
			left = mid + 1
	return left

def bisect_elements(a, x):
	return bisect_right(a, x) - bisect_left(a, x)
MOD = 10 ** 9 + 7
maxN = 5
FACT = [0] * maxN
INV_FACT = [0] * maxN

def add(x, y):
	return (x + y) % MOD

def multiply(x, y):
	return x * y % MOD

def power(x, y):
	if y == 0:
		return 1
	elif y % 2:
		return multiply(x, power(x, y - 1))
	else:
		a = power(x, y // 2)
		return multiply(a, a)

def inverse(x):
	return power(x, MOD - 2)

def divide(x, y):
	return multiply(x, inverse(y))

def allFactorials():
	FACT[0] = 1
	for i in range(1, maxN):
		FACT[i] = multiply(i, FACT[i - 1])

def inverseFactorials():
	n = len(INV_FACT)
	INV_FACT[n - 1] = inverse(FACT[n - 1])
	for i in range(n - 2, -1, -1):
		INV_FACT[i] = multiply(INV_FACT[i + 1], i + 1)

def coeffBinom(n, k):
	if n < k:
		return 0
	return multiply(FACT[n], multiply(INV_FACT[k], INV_FACT[n - k]))

def create_graph(n, m, undirected=1, unweighted=1):
	graph = [[] for i in range(n)]
	if unweighted:
		for i in range(m):
			[x, y] = li(lag=-1)
			graph[x].append(y)
			if undirected:
				graph[y].append(x)
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			graph[x].append([y, w])
			if undirected:
				graph[y].append([x, w])
	return graph

def create_tree(n, unweighted=1):
	children = [[] for i in range(n)]
	if unweighted:
		for i in range(n - 1):
			[x, y] = li(lag=-1)
			children[x].append(y)
			children[y].append(x)
	else:
		for i in range(n - 1):
			[x, y, w] = li(lag=-1)
			w += 1
			children[x].append([y, w])
			children[y].append([x, w])
	return children

def dist(tree, n, A, B=-1):
	s = [[A, 0]]
	(massimo, massimo_nodo) = (0, 0)
	distanza = -1
	v = [-1] * n
	while s:
		(el, dis) = s.pop()
		if dis > massimo:
			massimo = dis
			massimo_nodo = el
		if el == B:
			distanza = dis
		for child in tree[el]:
			if v[child] == -1:
				v[child] = 1
				s.append([child, dis + 1])
	return (massimo, massimo_nodo, distanza)

def diameter(tree):
	(_, foglia, _) = dist(tree, n, 0)
	(diam, _, _) = dist(tree, n, foglia)
	return diam

def dfs(graph, n, A):
	v = [-1] * n
	s = [[A, 0]]
	v[A] = 0
	while s:
		(el, dis) = s.pop()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def bfs(graph, n, A):
	v = [-1] * n
	s = deque()
	s.append([A, 0])
	v[A] = 0
	while s:
		(el, dis) = s.popleft()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def parents_children_root_unrooted_tree(tree, n, root=0):
	q = deque()
	visited = [0] * n
	parent = [-1] * n
	children = [[] for i in range(n)]
	q.append(root)
	while q:
		all_done = 1
		visited[q[0]] = 1
		for child in tree[q[0]]:
			if not visited[child]:
				all_done = 0
				q.appendleft(child)
		if all_done:
			for child in tree[q[0]]:
				if parent[child] == -1:
					parent[q[0]] = child
					children[child].append(q[0])
			q.popleft()
	return (parent, children)

def all_longest_path_passing_from_node(parent, children, n):
	q = deque()
	visited = [len(children[i]) for i in range(n)]
	downwards = [[0, 0] for i in range(n)]
	upward = [1] * n
	longest_path = [1] * n
	for i in range(n):
		if not visited[i]:
			q.append(i)
			downwards[i] = [1, 0]
	while q:
		node = q.popleft()
		if parent[node] != -1:
			visited[parent[node]] -= 1
			if not visited[parent[node]]:
				q.append(parent[node])
		else:
			root = node
		for child in children[node]:
			downwards[node] = sorted([downwards[node][0], downwards[node][1], downwards[child][0] + 1], reverse=True)[0:2]
	s = [node]
	while s:
		node = s.pop()
		if parent[node] != -1:
			if downwards[parent[node]][0] == downwards[node][0] + 1:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][1])
			else:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][0])
		longest_path[node] = downwards[node][0] + downwards[node][1] + upward[node] - min([downwards[node][0], downwards[node][1], upward[node]]) - 1
		for child in children[node]:
			s.append(child)
	return longest_path
digits = [str(i) for i in range(10)]
sep = [',', ';']
s = si()
i = 0
st = 0
flag = True
num = []
non = []
s = s.replace(';', ',').split(',')
for el in s:
	flag = True
	if el == '0':
		flag = True
	elif el == '':
		flag = False
	else:
		if el[0] == '0':
			flag = False
		for ch in el:
			if ch not in digits:
				flag = False
	if flag == True:
		num.append(el)
	else:
		non.append(el)
res1 = ','.join(num)
res2 = ','.join(non)
if num:
	print('"' + res1 + '"')
else:
	print('-')
if non:
	print('"' + res2 + '"')
else:
	print('-')


data = input()
integer = []
noninteger = []
flag = False
item = ''
for i in data:
	if i in ',;':
		if flag:
			noninteger.append('')
		elif item == '0':
			integer.append(item)
		elif item.isdigit() and item[0] != '0':
			integer.append(item)
		else:
			noninteger.append(item)
		item = ''
		flag = True
	else:
		item += i
		flag = False
if item:
	if item == '0':
		integer.append(item)
	elif item.isdigit() and item[0] != '0':
		integer.append(item)
	else:
		noninteger.append(item)
elif data[-1] in ',;':
	noninteger.append('')
if integer:
	print('"' + ','.join(integer) + '"')
else:
	print('-')
if noninteger:
	print('"' + ','.join(noninteger) + '"')
else:
	print('-')


import re
try:
	while True:
		a = []
		b = []
		for word in re.split('[,;]', input()):
			(a if re.match('^(0|[1-9][0-9]*)$', word) else b).append(word)
		print('"%s"' % ','.join(a) if a else '-')
		print('"%s"' % ','.join(b) if b else '-')
except EOFError:
	pass


import sys
s = sys.stdin.readline()
tokens = s.strip().replace(',', ';').split(';')
(s1, s2) = ([], [])
if len(tokens) == 1 and tokens[0] == '':
	print('-\n-')
	sys.exit(0)
for tok in tokens:
	if len(tok) > 1 and tok[0] == '0':
		s2 += [tok]
		continue
	try:
		i = int(tok)
		s1 += [tok]
	except:
		s2 += [tok]
print('"' + ','.join(s1) + '"' if len(s1) > 0 else '-')
print('"' + ','.join(s2) + '"' if len(s2) > 0 else '-')


import re
w = re.split('[,;]', input())
a = [i for i in w if len(i) > 0 and (not (i[0] == '0' and len(i) > 1)) and i.isdigit()]
b = [i for i in w if i not in a]
for t in (a, b):
	print('"' + ','.join(t) + '"' if len(t) > 0 else '-')


import sys

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip('\n')
s = input()
l = s.split(';')
string = []
integer = []
flag = False
for i in range(len(l)):
	if l[i] == '':
		string.append(l[i])
		continue
	if ',' in l[i]:
		k = l[i].split(',')
		flag = True
	if flag:
		for j in k:
			if j == '':
				string.append('')
			elif j[0] == '0':
				if len(j) == 1:
					integer.append(j)
				else:
					string.append(j)
			else:
				try:
					integer.append(int(j))
				except:
					string.append(j)
		flag = False
	elif l[i][0] == '0':
		if len(l[i]) == 1:
			integer.append(l[i])
		else:
			string.append(l[i])
	else:
		try:
			integer.append(int(l[i]))
		except:
			string.append(l[i])
if len(integer) != 0:
	print('"', end='')
	print(*integer, sep=',', end='')
	print('"')
else:
	print('-')
if len(string) != 0:
	print('"', end='')
	print(*string, sep=',', end='')
	print('"')
else:
	print('-')


s = input()
t = ''
b = ''
a = ''
for i in range(len(s)):
	if not s[i] in [';', ',']:
		t += s[i]
	else:
		if t.isdigit() and (not (len(t) > 1 and t[0] == '0')):
			a += t + ','
		else:
			b += t + ','
		t = ''
if t.isdigit() and (not (len(t) > 1 and t[0] == '0')):
	a += t + ','
else:
	b += t + ','
if not len(a) == 0:
	print('"' + a[:-1] + '"')
else:
	print('-')
if not len(b) == 0:
	print('"' + b[:-1] + '"')
else:
	print('-')


def single(l):
	return [i for sub in l for i in sub]
s = input()
words = single([x.split(',') for x in s.split(';')])
no = []
rest = []
for i in words:
	if len(i) > 1 and i[0] == '0':
		rest.append(i)
		continue
	try:
		j = int(i)
		no.append(i)
	except:
		rest.append(i)
if len(no) >= 1:
	print('"' + ','.join(no) + '"')
else:
	print('-')
if len(rest) >= 1:
	print('"' + ','.join(rest) + '"')
else:
	print('-')


def pri(a):
	if len(a) > 0:
		print('"' + ','.join(a) + '"')
	else:
		print('-')

def main():
	mode = 'filee'
	if mode == 'file':
		f = open('test.txt', 'r')
	get = lambda : [int(x) for x in (f.readline() if mode == 'file' else input()).split()]
	g = input()
	g = list(g)
	for i in range(len(g)):
		if g[i] == ',':
			g[i] = ';'
	g = ''.join(g)
	g = g.split(';')
	a = []
	b = []
	for i in g:
		try:
			h = int(i)
			if i[0] != '0' or i == '0':
				a.append(i)
			else:
				b.append(i)
		except:
			b.append(i)
	pri(a)
	pri(b)
	if mode == 'file':
		f.close()
main()


import re

def isgood(item):
	try:
		if len(item) > 1 and item[0] == '0':
			return False
		val = int(item)
		if val < 0:
			return False
	except ValueError:
		return False
	return True
s = input()
(a, b) = ([], [])
for x in re.split(',|;', s):
	(a if isgood(x) else b).append(x)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
l = re.split('[,,;]', input())
ans_int = '-'
ans_str = '-'
for i in l:
	if re.match('^[1-9][0-9]*$|^0$', i) != None:
		if ans_int == '-':
			ans_int = i
		else:
			ans_int += ',' + i
	elif i != '':
		if ans_str == '-':
			ans_str = i
		else:
			ans_str += ',' + i
	elif ans_str == '-':
		ans_str = ''
	else:
		ans_str += ','
if ans_int == '-':
	print(ans_int)
else:
	print('"' + ans_int + '"')
if ans_str == '-':
	print(ans_str)
else:
	print('"' + ans_str + '"')


def is_good(str):
	if len(str) == 0:
		return False
	if len(str) == 1 and (not (str[0] < '0' or str[0] > '9')):
		return True
	if not (str[0] > '0' and str[0] <= '9'):
		return False
	for i in range(len(str)):
		if str[i] < '0' or str[i] > '9':
			return False
	return True
a = []
b = []
s = input()
str = ''
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		if is_good(str):
			a.append(str)
		else:
			b.append(str)
		str = ''
		continue
	str += s[i]
if is_good(str):
	a.append(str)
else:
	b.append(str)
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(a)):
		print(a[i], end='')
		if i != len(a) - 1:
			print(',', end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(b)):
		print(b[i], end='')
		if i != len(b) - 1:
			print(',', end='')
	print('"', end='')


s = input()
s = s.replace(';', ',')
ls = s.split(',')
a = ''
b = ''
bw = 'no'
for element in ls:
	if element.isdigit() and (element[0] != '0' or element == '0'):
		a += element + ','
	elif element == '':
		b += element + ','
		bw = 'yes'
	else:
		b += element + ','
a = a[:-1]
b = b[:-1]
if a == '':
	print('-')
else:
	print('"' + a + '"')
if b == '' and bw == 'no':
	print('-')
else:
	print('"' + b + '"')


s = input().strip()
words = []
aux = []
for c in s:
	if c in ',;':
		words.append(''.join(aux))
		aux.clear()
	else:
		aux.append(c)
words.append(''.join(aux))

def isClass1(s):
	if len(s) == 0:
		return False
	if not all([c.isdigit() for c in s]):
		return False
	if s == '0':
		return True
	return s[0] != '0'
A = list(filter(isClass1, words))
B = list(filter(lambda s: not isClass1(s), words))
if len(A):
	A = ','.join(A)
	A = f'"{A}"'
else:
	A = '-'
if len(B):
	B = ','.join(B)
	B = f'"{B}"'
else:
	B = '-'
print(A)
print(B)


s = input().split(',')
a = '"'
b = '"'
for t in s:
	for word in t.split(';'):
		if word.isdigit() and (word[0] != '0' or word == '0'):
			a = a + word + ','
		else:
			b = b + word + ','
if len(a) == 1:
	print('-')
else:
	print(a[0:len(a) - 1] + '"')
if len(b) == 1:
	print('-')
else:
	print(b[0:len(b) - 1] + '"')


s = input()
s = s.replace(',', ';')
word = s.split(';')
a = []
b = []
for i in word:
	if i.isdigit() == False:
		b.append(i)
	elif i[0] == '0' and len(i) > 1:
		b.append(i)
	else:
		a.append(i)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import sys
import re
from math import ceil, log, sqrt, floor
__local_run__ = False
if __local_run__:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def isNum(s):
	if len(s) == 0:
		return False
	if s[0] == '0':
		return True if len(s) == 1 else False
	for char in s:
		if char not in '0123456789':
			return False
	return True

def main():
	parts = input().replace(',', ' ').replace(';', ' ').split(' ')
	a = []
	b = []
	for p in parts:
		if isNum(p):
			a.append(p)
		else:
			b.append(p)
	if len(a) == 0:
		print('-')
	else:
		print('"' + ','.join(a) + '"')
	if len(b) == 0:
		print('-')
	else:
		print('"' + ','.join(b) + '"')
main()


import queue
s = input()
s = s.replace(';', ',')
tmp = s.split(',')
a = []
b = []
for ss in tmp:
	if ss.isnumeric() and (ss == '0' or (ss[0] != '-' and ss[0] != '0')):
		a.append(ss)
	else:
		b.append(ss)
for ans in [a, b]:
	if len(ans) == 0:
		print('-')
	else:
		print('"', ','.join(ans), '"', sep='')


s = input().replace(';', ',').split(',')
fs = []
ss = []
for i in s:
	if i.isdecimal():
		if len(i) == 1 and i[0] == '0':
			fs.append(i)
		elif len(i) != 1 and i[0] == '0':
			ss.append(i)
		else:
			fs.append(i)
	else:
		ss.append(i)
if fs:
	print('"' + ','.join(fs) + '"')
else:
	print('-')
if ss:
	print('"' + ','.join(ss) + '"')
else:
	print('-')


line = input().replace(';', ',').split(',')
nums = []
words = []
for w in line:
	if w.isdigit():
		if int(w) > 0:
			if w[0] == '0':
				words.append(w)
			else:
				nums.append(w)
		elif int(w) == 0:
			if len(w) > 1:
				words.append(w)
			else:
				nums.append(w)
		else:
			words.append(w)
	else:
		words.append(w)
a = '-'
if len(nums) > 0:
	a = '"{0}"'.format(','.join(nums))
b = '-'
if len(words) > 0:
	b = '"{0}"'.format(','.join(words))
print(a)
print(b)


s = input()
s = s.replace(',', ';')
s = s.split(';')
a = []
b = []
for i in s:
	if i.isnumeric() and (i[0] != '0' or len(i) == 1):
		a.append(i)
	else:
		b.append(i)
if a != []:
	print('"%s"' % ','.join(a))
else:
	print('-')
if b != []:
	print('"%s"' % ','.join(b))
else:
	print('-')


def isNumber(x):
	try:
		p = int(x)
		return x == str(p)
	except:
		return False

def conc(p):
	if len(p) == 0:
		return '-'
	s = '"'
	for i in range(len(p) - 1):
		s += p[i] + ','
	s += p[len(p) - 1] + '"'
	return s
s = input().split(';')
p = []
q = []
for l in s:
	for i in l.split(','):
		if isNumber(i):
			p.append(i)
		else:
			q.append(i)
p = conc(p)
q = conc(q)
print(p)
print(q)


import sys
s = input()
a = []
b = []
num = ''
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		if num.isnumeric() and (len(num) == 1 or num[0] != '0'):
			a.append(num)
		else:
			b.append(num)
		num = ''
	else:
		num += s[i]
if num.isnumeric() and (len(num) == 1 or num[0] != '0'):
	a.append(num)
else:
	b.append(num)
num = ''
if len(a) > 0:
	print('"', end='')
	for i in range(len(a)):
		print(a[i], end='' if i == len(a) - 1 else ',')
	print('"')
else:
	print('-')
if len(b) > 0:
	print('"', end='')
	for i in range(len(b)):
		print(b[i], end='' if i == len(b) - 1 else ',')
	print('"')
else:
	print('-')


def split_simbols(s, spl):
	ans = []
	seq = ''
	for c in s:
		if c not in spl:
			seq += c
		else:
			ans.append(seq)
			seq = ''
	ans.append(seq)
	return ans

def main():
	s = input()
	s = split_simbols(s, [';', ','])
	a = []
	b = []
	for w in s:
		if w.isdigit():
			if str(int(w)) == w:
				a.append(w)
			else:
				b.append(w)
		else:
			b.append(w)
	if not a:
		print('-')
	else:
		print('"%s"' % ','.join(a))
	if not b:
		print('-')
	else:
		print('"%s"' % ','.join(b))
main()


def isInt(s):
	try:
		int(s)
		return True
	except ValueError:
		return False
s = input()
s1 = s.split(';')
a = '"'
b = '"'
f = False
for i in s1:
	s2 = i.split(',')
	for j in s2:
		if isInt(j):
			if j[0] == '0' and j != '0' or j.find('.') != -1 or int(j) < 0:
				if b != '"' or f == True:
					b = b + ',' + j
				else:
					b = b + j
			elif a != '"':
				a = a + ',' + j
			else:
				a = a + j
		else:
			if b != '"' or f == True:
				b = b + ',' + j
			else:
				b = b + j
			if j == '':
				f = True
if a == '"':
	print('-')
else:
	print(a + '"')
if b == '"' and f == False:
	print('-')
else:
	print(b + '"')


import re
word_input = input()
s_Words = re.split('[,;:]', word_input)
numbers = []
letter = []
for i in s_Words:
	if i != '0' and all((j == '0' for j in i)):
		letter.append(i)
		continue
	elif i.isdigit() and (not i.startswith('0') or len(i.lstrip('0')) == 0):
		numbers.append(i)
		continue
	else:
		letter.append(i)
if len(numbers) > 0:
	print('"%s"' % ','.join(numbers))
elif len(numbers) == 0:
	print('-')
if len(letter) > 0:
	print('"%s"' % ','.join(letter))
elif len(letter) == 0:
	print('-')


from __future__ import print_function
import sys
line = input().replace(',', ';')
ws = line.split(';')
a = []
b = []
for word in ws:
	if word.isdigit():
		if word == '0' or not word.startswith('0'):
			a.append(word)
		else:
			b.append(word)
	else:
		b.append(word)
if len(a) == 0:
	print('-')
else:
	print('"{0}"'.format(','.join(a)))
if len(b) == 0:
	print('-')
else:
	print('"{0}"'.format(','.join(b)))


s = input().split(';')
l = []
for i in s:
	l += i.split(',')
a = ''
b = ''
int
for word in l:
	flag = True
	for sym in word:
		if not sym in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
			flag = False
			break
	if len(word) > 1 and word[0] == '0':
		flag = False
	if flag and word != '':
		a += word + ','
	else:
		b += word + ','
if len(a) == 0:
	print('-')
else:
	print('"' + a[0:-1] + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + b[0:-1] + '"')


import re
words = input()
splited_words = re.split('[,;:]', words)
digits = []
words = []
for e in splited_words:
	if e != '0' and all((c == '0' for c in e)):
		words.append(e)
		continue
	elif e.isdigit() and (not e.startswith('0') or len(e.lstrip('0')) == 0):
		digits.append(e)
		continue
	else:
		words.append(e)
if len(digits) > 0:
	print('"%s"' % ','.join(digits))
elif len(digits) == 0:
	print('-')
if len(words) > 0:
	print('"%s"' % ','.join(words))
elif len(words) == 0:
	print('-')


s = list(input())
l = len(s)
for i in range(l):
	if s[i] == ',':
		s[i] = ';'
s = ''.join(s)
s = s.split(';')
no = []
w = []
for i in s:
	try:
		if not (len(i) > 1 and i[0] == '0'):
			n = int(i)
			no.append(n)
		else:
			w.append(i)
	except ValueError:
		w.append(i)
if len(no):
	print('"', end='')
	for i in range(len(no) - 1):
		print(no[i], end=',')
	print(no[-1], end='')
	print('"')
else:
	print('-')
no = w
if len(no):
	print('"', end='')
	for i in range(len(no) - 1):
		print(no[i], end=',')
	print(no[-1], end='')
	print('"')
else:
	print('-')


input_str = input()
input_set = set(input_str)
if input_set == {','} or input_set == {';'}:
	print('-')
	print('"' + ',' * len(input_str) + '"')
	exit()
split_input = input_str.replace(';', ',').split(',')
list_a = []
list_b = []
for element in split_input:
	if element == '0':
		list_a.append(element)
	elif len(element) == 0:
		list_b.append(element)
	elif '0' != element[0] and '.' not in element and element.isnumeric():
		list_a.append(element)
	else:
		list_b.append(element)
if len(list_a) == 0:
	print('-')
else:
	print('"%s"' % ','.join(list_a))
if len(list_b) == 0:
	print('-')
else:
	print('"%s"' % ','.join(list_b))


s = input()
n = len(s)
a_list = []
b_list = []
words = []
aux = ''
for i in range(n):
	c = s[i]
	if c == ';' or c == ',':
		words.append(aux)
		aux = ''
	else:
		aux += c
words.append(aux)
for w in words:
	if w.isdigit() and (w[0] != '0' or w == '0') and ('.' not in w):
		a_list.append(w.strip())
	else:
		b_list.append(w.strip())
a = ''
b = ''
if len(a_list) == 0:
	a = '-'
else:
	a = '"' + ','.join(a_list) + '"'
if len(b_list) == 0:
	b = '-'
else:
	b = '"' + ','.join(b_list) + '"'
print(a)
print(b)


s = str(input())
numb = '"'
lines = '"'
mass = list
s = s.replace(';', ',')
for item in s.split(','):
	if item.isdigit() and (item[0] != '0' or len(item) == 1):
		numb += item + ','
	else:
		lines += item + ','
if numb == '"':
	print('-')
else:
	numb = numb[0:-1] + '"'
	print(numb)
if lines == '"':
	print('-')
else:
	lines = lines[0:-1] + '"'
	print(lines)


import re
s = input()
s = re.split('[,;]', s)
(ans1, ans2) = ([], [])
for w in s:
	if w.isdecimal():
		if w == str(int(w)):
			ans1.append(w)
		else:
			ans2.append(w)
	else:
		ans2.append(w)
print('"' + ','.join(ans1) + '"' if ans1 else '-')
print('"' + ','.join(ans2) + '"' if ans2 else '-')


import re
s = input()
s = re.split('[;,]', s)
a = ''
b = ''
for item in s:
	if item.isnumeric():
		if item.find('.') == -1:
			if not item.startswith('0') or item == '0':
				a += item + ','
			else:
				b += item + ','
		else:
			b += item + ','
	else:
		b += item + ','
if len(a) == 0:
	a = '-'
else:
	if a.endswith(','):
		a = a[0:len(a) - 1]
	a = '"' + a + '"'
if len(b) == 0:
	b = '-'
else:
	if b.endswith(','):
		b = b[0:len(b) - 1]
	b = '"' + b + '"'
print(a)
print(b)


s = input()
a = []
x = 0
x1 = 0
x2 = 0
if s.count(';') + s.count(',') != -2:
	for i in range(0, s.count(';') + s.count(',') + 1):
		x1 = s.find(';')
		x = s.find(',')
		if x1 == -1:
			x2 = x
			a.append(s[:x2])
			s = s[x2 + 1:len(s)]
		elif x == -1:
			x2 = x1
			a.append(s[:x2])
			s = s[x2 + 1:len(s)]
		else:
			x2 = min(x, x1)
			a.append(s[:x2])
			s = s[x2 + 1:len(s)]
del a[len(a) - 1]
a.append(s)
strings = ''
numbers = ''
for j in range(len(a)):
	if a[j].isalpha() == True or a[j] == '' or (a[j].count('.') != -1 and a[j].isdigit() == False) or (a[j][0] == '0' and len(a[j]) > 1):
		strings += ',' + a[j]
	else:
		numbers += ',' + a[j]
if len(numbers) == 0:
	print('-')
	print('"' + strings[1:len(strings) + 1] + '"')
elif len(strings) == 0:
	print('"' + numbers[1:len(numbers) + 1] + '"')
	print('-')
else:
	print('"' + numbers[1:len(numbers) + 1] + '"')
	print('"' + strings[1:len(strings) + 1] + '"')


import logging
import copy
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)

def solve(inputLine):
	aStr = []
	bStr = []
	for dummy in inputLine.split(','):
		for word in dummy.split(';'):
			try:
				if word == str(int(word)):
					aStr.append(word)
				else:
					bStr.append(word)
			except:
				bStr.append(word)
	for lst in [aStr, bStr]:
		if len(lst) == 0:
			print('-')
		else:
			print('"%s"' % ','.join(lst))
	log(aStr)
	log(bStr)
	return

def main():
	firstLine = input()
	solve(firstLine)

def log(*message):
	logging.debug(message)
main()


s = input()
s = s + ';'
a = ''
b = ''
a_is = False
b_is = False
nw = ''
num = True
for chr in s:
	if chr == ';' or chr == ',':
		if len(nw) == 0:
			num = False
		if len(nw) > 1 and nw[0] == '0':
			num = False
		if num:
			a = a + ',' + nw
			a_is = True
		else:
			b = b + ',' + nw
			b_is = True
		nw = ''
		num = True
		continue
	nw = nw + chr
	if ord(chr) < 48 or ord(chr) > 57:
		num = False
a = a[1:]
b = b[1:]
a = '"' + a + '"'
b = '"' + b + '"'
if a_is:
	print(a)
else:
	print('-')
if b_is:
	print(b)
else:
	print('-')


def Int(s):
	try:
		int(s)
		if len(s) > 1 and s[0] == '0':
			return False
		return True
	except ValueError:
		return False

def notInt(s):
	try:
		int(s)
		if len(s) > 1 and s[0] == '0':
			return True
		return False
	except ValueError:
		return True
s = input().replace(';', ',').split(',')
a = list(filter(Int, s))
b = list(filter(notInt, s))
if len(a) != 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) != 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


import itertools
s = [x.split(',') for x in input().split(';')]
s = list(itertools.chain(*s))

def parr(x):
	if len(x) == 0:
		print('-')
	else:
		print('"' + ','.join(x) + '"')
a = []
b = []
for x in s:
	if len(x) == 0:
		b.append(x)
		continue
	cnt = 0
	for i in '0123456789':
		cnt += x.count(i)
	if cnt == len(x) and (x[0] != '0' or len(x) == 1):
		a.append(x)
	else:
		b.append(x)
parr(a)
parr(b)


s = input().replace(';', ',').split(',')
arr1 = []
arr2 = []
for i in s:
	if i.isdigit() and (i == '0' or i[0] != '0'):
		arr1.append(i)
	else:
		arr2.append(i)
print('"' + ','.join(arr1) + '"' if len(arr1) else '-')
print('"' + ','.join(arr2) + '"' if len(arr2) else '-')


first = str(input()).split(',')
second = [str(x).split(';') for x in first]
final = []
for x in second:
	final.extend(x)
(a, b) = ([], [])
for x in final:
	try:
		isnumber = int(x)
		a.append(x) if str(isnumber) == x else b.append(x)
	except:
		b.append(x)
print('-') if not a else print('"' + ','.join(a) + '"')
print('-') if not b else print('"' + ','.join(b) + '"')


a = list(map(str, input().replace(';', ',').split(',')))
c = []
d = []
for i in a:
	try:
		if str(int(i)) == i:
			c += [i]
		else:
			d += [i]
	except:
		d += [i]
if len(c) == 0:
	print('-')
else:
	ans = ''
	for i in c:
		ans += i + ','
	print('"' + ans[:-1] + '"')
if len(d) == 0:
	print('-')
else:
	ans = ''
	for i in d:
		ans += i + ','
	print('"' + ans[:-1] + '"')


s = input()
words = s.replace(',', ';').split(';')
a = []
b = []
for i in words:
	try:
		int(i)
		if len(str(int(i))) != len(i):
			raise ValueError
		a.append(i)
	except:
		b.append(i)
if len(a) > 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) > 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


q = 'aba,123;1a;0'
q = '1;;01,a0,'
q = '1'
q = 'a'
import re
s = re.split(',|;', input())
pattern = '([1-9][0-9]*)|(0)'
regex = re.compile(pattern)
a = []
b = []
for i in s:
	m = regex.match(i)
	if len(i) == 0 or m == None or i[m.start():m.end()] != i:
		b.append(i)
	else:
		a.append(i)
if len(a) == 0:
	a = '-'
else:
	a = '"' + ','.join(a) + '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + ','.join(b) + '"'
print(a)
print(b)


import re
s = input()
f = s.split(',')
s = []
for i in f:
	s += i.split(';')
fir = []
sec = []
reg = re.compile('[1-9]\\d*')
for i in s:
	if reg.fullmatch(i) == None and i != '0':
		sec.append(i)
	else:
		fir.append(i)
if len(fir) > 0:
	print('"' + ','.join(fir) + '"')
else:
	print('-')
if len(sec) > 0:
	print('"' + ','.join(sec) + '"')
else:
	print('-')


s = input()
nums = []
tokens = []
if len(s) == 1:
	if s[0].isdigit():
		nums.append(s[0])
	elif s[0] == ';':
		tokens.extend(['', ''])
	else:
		tokens.append(s[0])
else:
	s = s.split(';')
	string = []
	for i in s:
		if ',' in i:
			string.extend(i.split(','))
		else:
			string.append(i)
	for i in range(len(string)):
		if string[i] == '':
			tokens.append(string[i])
		elif string[i][0] == '0' and len(string[i]) == 1:
			nums.append(string[i])
		elif string[i][0] != '0' and string[i].isdigit():
			nums.append(string[i])
		else:
			tokens.append(string[i])
if not nums:
	print('-')
else:
	print('"', end='')
	print(*nums, sep=',', end='')
	print('"')
if not tokens:
	print('-')
else:
	print('"', end='')
	print(*tokens, sep=',', end='')
	print('"')


s = input()
q = []
z = ''
for i in s:
	if i in [',', ';']:
		q.append(z)
		z = ''
	else:
		z += i
q.append(z)
(a, b) = ([], [])
for i in q:
	if len(i) > 0 and (i == '0' or (i[0] != '0' and i.isdigit())):
		a.append(i)
	else:
		b.append(i)
if a != []:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b != []:
	print('"' + ','.join(b) + '"')
else:
	print('-')


s = input()
a = []
b = []
last_word = []
temp = 0
digits = '0123456789'
for letter in s:
	if letter == ';' or letter == ',':
		for leter in last_word:
			if digits.find(leter) == -1:
				temp = 1
				break
		if temp == 0 and len(last_word) != 0:
			if last_word[0] != '0' or len(last_word) == 1:
				a += ''.join(last_word).split()
			else:
				b += ''.join(last_word).split()
		elif len(last_word) == 0:
			temp = 0
			b += ['']
		else:
			temp = 0
			b += ''.join(last_word).split()
		last_word = []
	else:
		last_word += letter
for leter in last_word:
	if digits.find(leter) == -1:
		temp = 1
		break
if temp == 0 and len(last_word) != 0:
	if last_word[0] != '0' or len(last_word) == 1:
		a += ''.join(last_word).split()
	else:
		b += ''.join(last_word).split()
elif len(last_word) == 0:
	temp = 0
	b += ['']
else:
	temp = 0
	b += ''.join(last_word).split()
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(a), end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(b), end='')
	print('"')


s = []
for i in input().split(','):
	s += i.split(';')
F = lambda x: x.isdigit() and str(int(x)) == x
G = lambda x: 1 - F(x)
z = '"'
a = ','.join(filter(F, s))
b = list(filter(G, s))
a = ['-', z + a + z][bool(a)]
b = ['-', z + ','.join(b) + z][bool(b)]
print(a + '\n' + b)


words = input().strip().replace(',', ';').split(';')
a = [w for w in words if w.isdigit() and w == str(int(w))]
sa = set(a)
b = [w for w in words if w not in sa]
if a:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(b) + '"')
else:
	print('-')


t = input()
s = ''
a = []
for i in range(len(t)):
	if t[i] != ',' and t[i] != ';':
		s = s + t[i]
	else:
		a.append(s)
		s = ''
a.append(s)
b = []
c = []
for i in range(len(a)):
	try:
		d = int(a[i])
		if len(a[i]) == len(str(int(a[i]))):
			b.append(a[i])
		else:
			c.append(a[i])
	except:
		c.append(a[i])
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')
if len(c) == 0:
	print('-')
else:
	print('"' + ','.join(c) + '"')


s = input()
a = []
b = []
c = ''
flag = True
for i in range(len(s)):
	if ord(s[i]) != 44 and ord(s[i]) != 59:
		if len(c) == 0:
			if s[i] == '0':
				flag = False
		if ord(s[i]) < 48 or ord(s[i]) > 57:
			flag = False
		c += s[i]
		if i == len(s) - 1:
			if (flag or c == '0') and c != '':
				a.append(c)
			else:
				b.append(c)
	else:
		if (flag or c == '0') and c != '':
			a.append(c)
		else:
			b.append(c)
		c = ''
		flag = True
		if i == len(s) - 1:
			if (flag or c == '0') and c != '':
				a.append(c)
			else:
				b.append(c)
if len(a) > 0:
	print('"' + ','.join((str(x) for x in a)) + '"')
else:
	print(chr(45))
if len(b) > 0:
	print('"' + ','.join((str(x) for x in b)) + '"')
else:
	print(chr(45))


import unittest
import sys
import re

class Nums:

	def __init__(self, test_inputs=None):
		it = iter(test_inputs.split('\n')) if test_inputs else None

		def uinput():
			return next(it) if it else sys.stdin.readline().rstrip()
		self.s = uinput()
		self.t = re.split(';|,', self.s)
		self.al = []
		self.bl = []
		for n in self.t:
			try:
				if str(int(n)) == n:
					self.al.append(n)
				else:
					self.bl.append(n)
			except:
				self.bl.append(n)

	def calculate(self):
		result = ''
		result += '-' if not self.al else '"' + ','.join(self.al) + '"'
		result += '\n'
		result += '-' if not self.bl else '"' + ','.join(self.bl) + '"'
		return result

class unitTests(unittest.TestCase):

	def test_single_test(self):
		test = 'aba,123;1a;0'
		d = Nums(test)
		self.assertEqual(Nums(test).calculate(), '"123,0"\n"aba,1a"')
		test = '1;;01,a0,'
		self.assertEqual(Nums(test).calculate(), '"1"\n",01,a0,"')
		test = '1'
		self.assertEqual(Nums(test).calculate(), '"1"\n-')
		test = 'a'
		self.assertEqual(Nums(test).calculate(), '-\n"a"')

	def time_limit_test(self, nmax):
		import random
		import timeit
		test = str(nmax) + ' ' + str(nmax) + '\n'
		numnums = [str(i) + ' ' + str(i + 1) for i in range(nmax)]
		test += '\n'.join(numnums) + '\n'
		nums = [random.randint(1, 10000) for i in range(nmax)]
		test += ' '.join(map(str, nums)) + '\n'
		start = timeit.default_timer()
		d = Nums(test)
		calc = timeit.default_timer()
		d.calculate()
		stop = timeit.default_timer()
		print('\nTimelimit Test: ' + '{0:.3f}s (init {1:.3f}s calc {2:.3f}s)'.format(stop - start, calc - start, stop - calc))
sys.setrecursionlimit(100000)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
sys.stdout.write(Nums().calculate())


def main():
	str = input().replace(';', ',')
	input_list = str.split(',')

	def pred(x):
		return x.isdigit() and (x[0] != '0' or len(x) == 1)
	lA = list(filter(pred, input_list))
	lB = list(filter(lambda x: not pred(x), input_list))
	print('"{}"'.format(','.join(lA))) if lA else print('-')
	print('"{}"'.format(','.join(lB))) if lB else print('-')
main()


import re
s = input()
l = re.split('[;|,]', s)
num = ''
word = ''
c = 0
for i in l:
	if i.isdigit():
		if len(i) == 1 and i[0] == '0':
			num += i + ','
		elif len(i) > 1 and i[0] == '0':
			word += i + ','
		else:
			num += i + ','
	else:
		word += i + ','
if len(num) != 0:
	c += 1
	if c == 1:
		print('"', end='')
	num = num[:-1]
	print(num, end='"')
	print('')
else:
	print('-')
c = 0
if len(word) != 0:
	c += 1
	if c == 1:
		print('"', end='')
	word = word[:-1]
	print(word, end='"')
	print('')
else:
	print('-')


s = input()
a = s.replace(';', ',').split(',')
(c, d) = ([], [])
for elem in a:
	if elem.isdigit() and (elem[0] != '0' or len(elem) == 1):
		c.append(elem)
	else:
		d.append(elem)
if len(c) == 0:
	print('-')
	print('"' + ','.join(d) + '"')
elif len(d) == 0:
	print('"' + ','.join(c) + '"')
	print('-')
else:
	print('"' + ','.join(c) + '"')
	print('"' + ','.join(d) + '"')


def isinteger(s):
	if not s:
		return False
	if s == '0':
		return True
	if s[0] == '-' or s[0] == '0':
		return False
	try:
		int(s)
		return True
	except ValueError:
		return False
s = input()
first_pass = s.split(';')
words = []
for word in first_pass:
	words.extend(word.split(','))
a = ''
b = ''
for word in words:
	if isinteger(word):
		a += ',' + word
	else:
		b += ',' + word
if a:
	a = str(a[1:])
	print('"' + a + '"')
else:
	print('-')
if b:
	b = str(b[1:])
	print('"' + b + '"')
else:
	print('-')


first = str(input()).split(',')
(second, final) = ([str(x).split(';') for x in first], [])
for x in second:
	final.extend(x)
a = [x for x in final if x.isnumeric() and str(int(x)) == x]
b = [x for x in final if not (x.isnumeric() and str(int(x)) == x)]
print('-') if not a else print('"' + ','.join(a) + '"')
print('-') if not b else print('"' + ','.join(b) + '"')


import re
s = str(input())
words = re.split(';|,', s)
a = '"'
b = '"'
for w in words:
	if w.isdigit() and w[0] != '0' or w == '0':
		a += w + ','
	else:
		b += w + ','
if a == '"':
	print('-')
else:
	a = a[:-1] + '"'
	print(a)
if b == '"':
	print('-')
else:
	b = b[:-1] + '"'
	print(b)


def split(s, delimiter):
	words = ['']
	for c in s:
		if c in delimiter:
			words.append('')
		else:
			words[-1] += c
	return words

def is_number(s):
	for c in s:
		if c not in '0123456789':
			return False
	if s == '0':
		return True
	return len(s) != 0 and s[0] != '0'
words = split(input(), ',;')
a = []
b = []
for word in words:
	if is_number(word):
		a.append(word)
	else:
		b.append(word)
if len(a) == 0:
	a = '-'
else:
	a = '"' + ','.join(a) + '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + ','.join(b) + '"'
print(a)
print(b)


import sys
input = sys.stdin.readline

def solve():
	s = input().strip().replace(';', ',').split(',')
	a = []
	b = []
	for w in s:
		if w.isdigit() and (w == '0' or w[0] != '0'):
			a.append(w)
		else:
			b.append(w)
	for e in (a, b):
		print('"{}"'.format(','.join(e)) if e else '-')
solve()


words = input().replace(';', ',').split(',')
(a, b) = ([], [])
for foo in words:
	if foo.isdigit() and (foo == '0' or foo[0] != '0'):
		a.append(foo)
	else:
		b.append(foo)
for v in (a, b):
	g = ','.join(v)
	print(['"' + g + '"', '-'][g == ',' * len(v)])


s = input().split(';')
a = []
b = []
for i in s:
	z = i.split(',')
	for j in z:
		if j == '':
			b.append(j)
		elif j[0] != '0' and j.isnumeric() or j == '0':
			a.append(j)
		else:
			b.append(j)
x = '"' + ','.join(a) + '"'
y = '"' + ','.join(b) + '"'
if len(a) == 0:
	print('-')
else:
	print(x)
if len(b) == 0:
	print('-')
else:
	print(y)


import re
ss = re.split(';|,', input())
a = []
b = []
p = re.compile('^(-?([1-9]\\d*)|0)$')
for s in ss:
	if p.match(s):
		a.append(s)
	else:
		b.append(s)
print('"' + ','.join(a) + '"' if len(a) else '-')
print('"' + ','.join(b) + '"' if len(b) else '-')


import sys
from re import split
input = sys.stdin.readline
S = split('[,;]', input()[:-1])
a = []
b = []
zero = ord('0')
nine = ord('9')
for s in S:
	if len(s) == 0:
		b += list(s) + [',']
		continue
	if len(s) > 1 and s[0] == '0':
		b += list(s) + [',']
		continue
	notint = 0
	for x in s:
		if ord(x) in range(zero, nine + 1):
			continue
		notint = 1
		break
	if notint:
		b += list(s) + [',']
	else:
		a += list(s) + [',']
if len(a):
	a.pop()
if len(b) > 1:
	b.pop()
elif len(b) == 1:
	b = ['']
if len(a):
	print('"' + ''.join(a) + '"')
else:
	print('-')
if len(b):
	print('"' + ''.join(b) + '"')
else:
	print('-')


def handleNumericChunk(chunk, A, B):
	if not chunk:
		B.append(chunk)
	elif chunk[0] == '0':
		if len(chunk) > 1:
			B.append(chunk)
		else:
			A.append(chunk)
	elif chunk.isdigit():
		A.append(chunk)
	else:
		B.append(chunk)
	return (A, B)

def extractNumbers(s):
	A = []
	B = []
	chunk = ''
	for (i, letter) in enumerate(s):
		if letter in ',;':
			(A, B) = handleNumericChunk(chunk, A, B)
			chunk = ''
		else:
			chunk += letter
	(A, B) = handleNumericChunk(chunk, A, B)
	return (A, B)

def formatOutput(l):
	if not l:
		return '-'
	else:
		temp = ['"']
		for x in l:
			temp.append(x)
			temp.append(',')
		temp[-1] = '"'
		return ''.join(temp)
s = input()
(A, B) = extractNumbers(s)
print(formatOutput(A))
print(formatOutput(B))


s = input()
s = s + ','
a = ''
b = ''
(start, end) = (0, 0)
for i in range(len(s)):
	if s[i] == ';' or s[i] == ',':
		if start != end:
			f = s[start:end]
		else:
			f = ''
		if f.isdigit() and f[0] != '0':
			a += f + ','
		elif f == '0':
			a += f + ','
		else:
			b += f + ','
		start = end + 1
		end += 1
	else:
		end += 1
if not a:
	a = '-'
else:
	a = a[:len(a) - 1]
	a = '"' + a + '"'
if not b:
	b = '-'
else:
	b = b[:len(b) - 1]
	b = '"' + b + '"'
print(a)
print(b)


s = str(input())
s = s.replace(';', ',')
words = s.split(',')
out = []
b = []
for w in words:
	if '.' in w:
		b.append(w)
		continue
	try:
		x = int(w)
		if len(w) > 1:
			if w[0] == '0':
				b.append(w)
				continue
		out.append(w)
	except Exception as e:
		b.append(w)
if len(out) == 0:
	print('-')
else:
	print('"' + ','.join(out) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


x = input()
y = ['']
for i in x:
	if i == ',' or i == ';':
		y.append('')
	else:
		y[-1] += i
nums = []
lets = []
for i in y:
	if i.isnumeric() and str(int(i)) == i:
		nums.append(i)
	else:
		lets.append(i)
if len(nums) == 0:
	print('-')
else:
	print('"' + ','.join(nums) + '"')
if len(lets) == 0:
	print('-')
else:
	print('"' + ','.join(lets) + '"')


def printList(ls):
	if len(ls) == 0:
		print('-')
	else:
		print('"', end='')
		for i in range(len(ls)):
			print(ls[i], end='')
			if i != len(ls) - 1:
				print(',', end='')
		print('"')
s = input().replace(',', ';').split(';')
pal = []
num = []
for i in range(len(s)):
	if not s[i] or (s[i][0] == '0' and len(s[i]) > 1) or (not s[i].isdigit()):
		pal.append(s[i])
	else:
		num.append(s[i])
printList(num)
printList(pal)


import re
st = re.split(';|,', input())
nums = []
chars = []
for x in st:
	if x.isdigit() and len(str(int(x))) == len(x):
		nums.append(x)
		continue
	chars.append(x)
print(f'''"{','.join(nums)}"''' if len(nums) else '-', f'''"{','.join(chars)}"''' if len(chars) else '-', sep='\n')


s = input()
s1 = len(s)
i = 0
(a, b) = ([], [])
while i < s1:
	j = i
	k = ''
	while j < s1 and s[j] != ';' and (s[j] != ','):
		k += s[j]
		j += 1
	k1 = len(k)
	if k1 == 0:
		b.append(k)
	elif k1 > 1 and (k[0] == '-' or k[0] == '0'):
		b.append(k)
	else:
		fl = 1
		for m in range(k1):
			k2 = ord(k[m])
			if k2 >= 48 and k2 <= 57:
				continue
			else:
				fl = 0
				break
		if fl:
			a.append(k)
		else:
			b.append(k)
	i = j + 1
if s[-1] == ';' or s[-1] == ',':
	b.append('')
a1 = len(a)
b1 = len(b)
if a1 > 0:
	print('"', end='')
	for i in range(a1):
		print(a[i], end='')
		if i != a1 - 1:
			print(',', end='')
	print('"')
else:
	print('-')
if b1 > 0:
	print('"', end='')
	for i in range(b1):
		print(b[i], end='')
		if i != b1 - 1:
			print(',', end='')
	print('"')
else:
	print('-')


import re
s = input()
a = []
b = []
for word in re.split(';|,', s):
	try:
		if str(int(word)) == word:
			a.append(word)
		else:
			b.append(word)
	except ValueError:
		b.append(word)
if a:
	print('"', end='')
	for e in a[:-1]:
		print(e, end=',')
	print(a[-1], end='')
	print(end='"\n')
else:
	print('-')
if b:
	print('"', end='')
	for e in b[:-1]:
		print(e, end=',')
	print(b[-1], end='')
	print(end='"\n')
else:
	print('-')


import re

def RepresentsInt(s):
	try:
		int(s)
		return True
	except ValueError:
		return False
s = input()
delimiter = (',', ';')
regexPattern = '|'.join(map(re.escape, delimiter))
X = re.split(regexPattern, s)
U = []
V = []
for ch in X:
	if RepresentsInt(ch) and ch == str(int(ch)):
		U.append(ch)
	else:
		V.append(ch)
if len(U) > 0:
	s = ','.join(U)
if len(V) > 0:
	t = ','.join(V)
if len(U) > 0:
	print('"' + str(s) + '"')
else:
	print('-')
if len(V) > 0:
	print('"' + str(t) + '"')
else:
	print('-')


def print_ans(arr):
	if len(arr) == 0:
		print('-')
	else:
		print('"', end='')
		print(*arr, sep=',', end='"\n')
s = input()
s = s.replace(';', ',')
s = s.split(',')
words = []
nums = []
for word in s:
	if len(word) == 0:
		words.append(word)
	else:
		if len(word) != 1:
			if word[0] == '-' and word[1:].isnumeric():
				nums.append(word)
				continue
		if word.isnumeric() and word.find('.') == -1 and (word[0] != '0' or word == '0'):
			nums.append(word)
		else:
			words.append(word)
print_ans(nums)
print_ans(words)


s = input()
a = []
b = []
index = 0
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		word = s[index:i]
		index = i + 1
		if word.find('.') != -1:
			b.append(word)
		elif word.isdigit() and word != str(int(word)):
			b.append(word)
		elif word.isdigit():
			a.append(word)
		else:
			b.append(word)
word = s[index:]
if word.find('.') != -1:
	b.append(word)
elif word.isdigit() and word != str(int(word)):
	b.append(word)
elif word.isdigit():
	a.append(word)
else:
	b.append(word)
if a != []:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b != []:
	print('"' + ','.join(b) + '"')
else:
	print('-')


def check(string):
	if string == '0':
		return True
	if len(string) == 0 or string[0] == '0':
		return False
	for i in string:
		if i not in '0123456789':
			return False
	return True

def spl(string):
	string += ','
	arr = []
	tmp = ''
	for smb in string:
		if smb in ',;':
			arr.append(tmp)
			tmp = ''
		else:
			tmp += smb
	return arr

def pnt(a):
	if a != '-,':
		print('"' + a[:-1] + '"')
	else:
		print(a[:-1])
s = spl(input())
a = ''
b = ''
for i in s:
	if check(i):
		a += i + ','
	else:
		b += i + ','
if a == '':
	a = '-,'
if b == '':
	b = '-,'
pnt(a)
pnt(b)


si = input()
s1 = ''
s2 = ''
sp = ''
beg = 0
pr = 0
for i in range(0, len(si)):
	if si[i] == ';' or si[i] == ',':
		sp = si[beg:i]
		if sp.isdigit():
			if len(sp) > 1 and sp[0] != '0':
				s1 = s1 + sp + ','
			elif len(sp) == 1:
				s1 = s1 + sp + ','
			else:
				s2 = s2 + sp + ','
		else:
			s2 = s2 + sp + ','
		beg = i + 1
	elif i == len(si) - 1:
		sp = si[beg:]
		if sp.isdigit():
			if len(sp) > 1 and sp[0] != '0':
				s1 = s1 + sp + ','
			elif len(sp) == 1:
				s1 = s1 + sp + ','
			else:
				s2 = s2 + sp + ','
		else:
			s2 = s2 + sp + ','
if si[len(si) - 1] == ',' or si[len(si) - 1] == ';':
	s2 = s2 + ','
if s1 == '':
	s1 = '-'
else:
	s1 = s1[:len(s1) - 1]
	s1 = '"' + s1 + '"'
if s2 == '':
	s2 = '-'
else:
	s2 = s2[:len(s2) - 1]
	s2 = '"' + s2 + '"'
print(s1)
print(s2)


import re

def is_int(s: str) -> bool:
	if len(s) > 0 and (s[0] == '0' and len(s) > 1):
		return False
	else:
		try:
			int(s)
			return True
		except:
			return False

def partition(pred, iterable):
	trues = []
	falses = []
	for item in iterable:
		if pred(item):
			trues.append(item)
		else:
			falses.append(item)
	return (trues, falses)

def print_ans(s):
	if len(s) > 0:
		print('"{}"'.format(','.join(s)))
	else:
		print('-')
s = re.split(';|,', input())
(s_int, s_str) = partition(is_int, s)
print_ans(s_int)
print_ans(s_str)


l = input().replace(';', ',').split(',')
res1 = []
res2 = []

def isValid(a):
	if a.startswith('0') and a != '0':
		return False
	else:
		return a.isnumeric()
for i in range(0, len(l)):
	if isValid(l[i]):
		res1.append(l[i])
	else:
		res2.append(l[i])
if len(res1) == 0:
	print('-')
else:
	print('"' + ','.join(res1) + '"')
if len(res2) == 0:
	print('-')
else:
	print('"' + ','.join(res2) + '"')


import math
from decimal import *
import sys
from fractions import Fraction
s = input()
l = len(s)
s2 = ''
for i in range(0, l):
	if s[i] == ';' or s[i] == ',':
		s2 += '# #'
	else:
		s2 += s[i]
sl = s2.split()
l = len(sl)
N = '0123456789'
a = []
b = []
for i in range(0, l):
	w = sl[i]
	l2 = len(w)
	num = 1
	if l2 != 0:
		if w[l2 - 1] == '#':
			w = w[:-1]
			l2 = len(w)
	if l2 != 0:
		if w[0] == '#':
			w = w[1:]
			l2 = len(w)
	if l2 == 0:
		num = 0
	for k in range(0, l2):
		if w[0] == '0' and l2 > 1:
			num = 0
		if w[k] not in N:
			num = 0
	if num == 1:
		a.append(w)
	else:
		b.append(w)
la = len(a)
lb = len(b)
sa = '"'
sb = '"'
if la == 0:
	sa = '-'
else:
	for i in range(0, la - 1):
		sa += a[i] + ','
	sa += a[la - 1] + '"'
print(sa)
if lb == 0:
	sb = '-'
else:
	for i in range(0, lb - 1):
		sb += b[i] + ','
	sb += b[lb - 1] + '"'
print(sb)


s = input()
word = ''
start = 0
end = -1
a = []
b = []
for (i, c) in enumerate(s):
	if c == ',' or c == ';':
		word = s[start:end + 1]
		failed = False
		try:
			myint = int(word)
			if word != str(myint):
				failed = True
		except ValueError:
			failed = True
		if failed:
			b.append(word)
		else:
			a.append(word)
		start = i + 1
	else:
		end = i
word = s[start:end + 1]
failed = False
try:
	myint = int(word)
	if word != str(myint):
		failed = True
except ValueError:
	failed = True
if failed:
	b.append(word)
else:
	a.append(word)
if len(a) == 0:
	print('-')
else:
	print('"', ','.join(a), '"', sep='')
if len(b) == 0 or len(s) == 0:
	print('-')
else:
	print('"', ','.join(b), '"', sep='')


def isCorrectNumber(n):
	if len(n) == 0:
		return False
	if len(n) == 1:
		return '0' <= n[0] <= '9'
	if not '0' < n[0] <= '9':
		return False
	for i in range(1, len(n)):
		if not '0' <= n[i] <= '9':
			return False
	return True
s = input() + ';'
(a, b) = ([], [])
ss = ''
for c in s:
	if c == ';' or c == ',':
		if isCorrectNumber(ss):
			a.append(ss)
		else:
			b.append(ss)
		ss = ''
	else:
		ss += c
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(a), end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(b), end='')
	print('"')


import re
s = input()
ar = re.split(',|;', s)
(s1, s2) = ([], [])
for i in ar:
	try:
		x = int(i)
		if len(i) == 1:
			s1.append(i)
		elif len(i) > 1:
			if i[0] == '0':
				s2.append(i)
			else:
				s1.append(i)
	except:
		s2.append(i)
quote = '"'
print(quote + ','.join(s1) + quote if s1 else '-')
print(quote + ','.join(s2) + quote if s2 else '-')


s = input()
s = s.split(',')
new_s = []
for x in s:
	new_s += x.split(';')
s = new_s
a = []
b = []
for x in s:
	if len(x) > 1 and x[0] == '0':
		b.append(x)
		continue
	try:
		a.append(str(int(x)))
	except:
		b.append(x)
if len(a) > 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) > 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


a = input().split(',')
b = []
for i in a:
	b.append(i.split(';'))
num = []
alpha = []
for i in b:
	for j in i:
		flag = 0
		if len(j) == 0 or (len(j) > 1 and j[0] == '0'):
			alpha.append(j)
			continue
		for l in j:
			if l >= '0' and l <= '9':
				continue
			else:
				flag = 1
		if flag == 1:
			alpha.append(j)
		else:
			num.append(j)
if len(num) == 0:
	print('-')
else:
	sal = '"'
	sal = sal + num[0]
	for i in range(1, len(num)):
		sal = sal + ',' + num[i]
	sal = sal + '"'
	print(sal)
if len(alpha) == 0:
	print('-')
else:
	sal = '"'
	sal = sal + alpha[0]
	for i in range(1, len(alpha)):
		sal = sal + ',' + alpha[i]
	sal = sal + '"'
	print(sal)


s = input()
s = s.split(',')
l = []
for i in s:
	tmp = i.split(';')
	for j in tmp:
		l.append(j)
a = []
b = []
for i in l:
	try:
		if int(i):
			if len(i) == len(str(int(i))):
				a.append(i)
			else:
				b.append(i)
		elif len(i) == len(str(int(i))):
			a.append(i)
		else:
			b.append(i)
	except:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	print(*a, sep=',', end='"')
	print()
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	print(*b, sep=',', end='"')
	print()


import re
s = input()
l = re.split('[,;]', s)
ln = list(filter(lambda x: x.isdigit() and x[0] != '-' and (x == '0' or x[0] != '0'), l))
ls = list(filter(lambda x: not (x.isdigit() and x[0] != '-' and (x == '0' or x[0] != '0')), l))
print('"' + ','.join(ln) + '"' if len(ln) != 0 else '-')
print('"' + ','.join(ls) + '"' if len(ls) != 0 else '-')


s = input()
s = s.replace(',', ';')
ss = s.split(';')
a = ''
b = ''
for s in ss:
	flag = False
	if len(s) != 0 and s[0] != '0':
		flag = True
		for c in s:
			if not c.isdigit():
				flag = False
				break
	if s == '0':
		a += '0,'
	elif flag:
		a += s + ','
	else:
		b += s + ','
print('"' + a[:-1] + '"' if a != '' else '-')
print('"' + b[:-1] + '"' if b != '' else '-')


s = input().replace(';', ',').split(',')
(a, b) = ([], [])
for i in s:
	if i.isdigit() and str(int(i)) == i:
		a.append(i)
	else:
		b.append(i)
if a:
	print('"{}"'.format(','.join(a)))
else:
	print('-')
if b:
	print('"{}"'.format(','.join(b)))
else:
	print('-')


import math as mt
import sys, string
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
s = input().strip()
x = s.split(';')
a = []
b = []
for i in x:
	e = i.split(',')
	for j in e:
		if j.isnumeric():
			if len(j) > 1:
				if j[0] == '0':
					b.append(j)
				else:
					a.append(j)
			else:
				a.append(j)
		else:
			b.append(j)
s = '"'
if len(a) == 0:
	print('-')
else:
	print(s, end='')
	for i in range(len(a)):
		if i == len(a) - 1:
			print(a[i], end='')
		else:
			print(a[i], end=',')
	print(s)
if len(b) == 0:
	print('-')
else:
	print(s, end='')
	for i in range(len(b)):
		if i == len(b) - 1:
			print(b[i], end='')
		else:
			print(b[i], end=',')
	print(s, end='')


import re
ip = input()
k = ip.split(';')
f = ','.join(k)
f = f.split(',')
a = []
b = []
for ele in f:
	k = re.match('^[^0a-zA-Z.][0-9]+$', ele)
	m = re.match('^[0-9]$', ele)
	if k:
		a.append(k.group(0))
	elif m:
		a.append(m.group(0))
	else:
		b.append(ele)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


l = input()
l = l.replace(';', ',')
l = l.split(',')
nums = []
alpha = []
for i in l:
	try:
		num = int(i)
		if str(num) == i:
			nums.append(str(num))
		else:
			alpha.append(i)
	except:
		alpha.append(i)
if len(nums) == 0:
	print('-')
else:
	print('"' + ','.join(nums) + '"')
if len(alpha) == 0:
	print('-')
else:
	print('"' + ','.join(alpha) + '"')


def printList(ls):
	if len(ls) == 0:
		print('-')
	else:
		print('"' + ','.join(ls) + '"')
pal = []
num = []
for s in input().replace(',', ';').split(';'):
	if not s or (s[0] == '0' and len(s) > 1) or (not s.isdigit()):
		pal.append(s)
	else:
		num.append(s)
printList(num)
printList(pal)


s = input()
L = []
d = ''
for i in range(len(s)):
	if s[i] != ',' and s[i] != ';':
		d += s[i]
	else:
		L.append(d)
		d = ''
L.append(d)
a = []
b = []
for i in range(len(L)):
	j = 0
	while j < len(L[i]):
		if ord(L[i][j]) < ord('0') or ord(L[i][j]) > ord('9'):
			break
		else:
			j = j + 1
	if j < len(L[i]) or j == 0:
		b.append(L[i])
	elif j >= 2 and L[i][0] == '0':
		b.append(L[i])
	else:
		a.append(L[i])
if len(a) == 0:
	print('-', end='')
else:
	print('"', end='')
	for i in range(len(a)):
		if i != len(a) - 1:
			print(a[i], end=',')
		else:
			print(a[i], end='')
	print('"', end='')
print('')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(b)):
		if i != len(b) - 1:
			print(b[i], end=',')
		else:
			print(b[i], end='')
	print('"', end='')


arr = input().split(',')

def check(s):
	if len(s) == 0:
		return False
	for c in s:
		if not (ord('0') <= ord(c) and ord(c) <= ord('9')):
			return False
	if s[0] == '0' and len(s) != 1:
		return False
	return True
(a, b) = ([], [])
for el in arr:
	tokens = el.split(';')
	for x in tokens:
		if check(x):
			a.append(x)
		else:
			b.append(x)
if len(a):
	print('"' + ','.join(map(str, a)) + '"')
else:
	print('-')
if len(b):
	print('"' + ','.join(map(str, b)) + '"')
else:
	print('-')


def valid(s):
	cor = True
	for c in s:
		if c < '0' or c > '9':
			cor = False
	if cor:
		if len(str(int(s))) == len(s):
			return True
		else:
			return False
	return False
s = input().replace(';', ',').split(',')
(a, b) = ([], [])
for i in s:
	if len(i) != 0 and valid(i):
		a.append(i)
	else:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
word = input()
tokens = re.split(';|,', word)
a = []
b = []
for token in tokens:
	if token == '0' or re.match('^[1-9]([0-9]*)$', token):
		a.append(token)
	else:
		b.append(token)
if a:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(b) + '"')
else:
	print('-')