Problem: 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| ≤ 105). 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", "".

Solution (in JAVA):

Solution:
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Scanner;

public class Masked{
	private static int[] permutatation ;
	private static boolean[] used;
	private static int[] binary;
	private static ArrayList<Integer> listString = new ArrayList<Integer>();
	private static HashSet<String> setInteger = new HashSet<String>();
	
	
	public static void main(String[] args){
		BracketSequence();
	}
	
	
	private static void BracketSequence(){
		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(0);
		for(int i = 0 ; i < s.length() ; i++){
			if(s.charAt(i) == ';' || s.charAt(i) == ','){
				list.add(i);
				//System.out.println("i: "+i);
			}
		}
		list.add(s.length());
		ArrayList<String> ansInt = new ArrayList<String>();
		ArrayList<String> ansStr = new ArrayList<String>();
		
		for(int i = 0 ; i < list.size()-1 ; i++){
			if(i != 0){
				String ss = s.substring(list.get(i)+1,list.get(i+1));
				//System.out.println("list.get(i)+1: "+(list.get(i)+1)+" list.get(i+1): "+list.get(i+1));
				//System.out.println("ss: "+ss);
				try{
					int ans = Integer.parseInt(ss);
					if(ss.length() > 1 && ss.charAt(0)== '0'){
						//System.out.println("String: "+ss);
						ansStr.add(ss);
					}else{
						ansInt.add(ss);
						//System.out.println("Integer: "+ans);
					}
				}catch(NumberFormatException e){
					boolean isInteger = false;
					for(int j = 0 ; j < ss.length() ; j++){
						if(ss.charAt(j) >= 48 && ss.charAt(j) <= 57){
							isInteger = true;
						}else{
							isInteger = false;
							break;
						}
					}
					if(isInteger){
						ansInt.add(ss);
					}else{
						ansStr.add(ss);
					}
					
					//System.out.println("String: "+ss);
				}catch(NullPointerException e){
					ansStr.add(ss);
					//System.out.println("String: "+ss);
				}
			}else{
				String ss = s.substring(0, list.get(i+1));
				//System.out.println("ss: "+ss);
				try{
					int ans = Integer.parseInt(ss);
					if(ss.length() > 1 && ss.charAt(0)== '0'){
					//	System.out.println("String: "+ans);
						ansStr.add(ss);
					}else{
						ansInt.add(ss);
						//System.out.println("Integer: "+ans);
					}
				}catch(NumberFormatException e){
					boolean isInteger = false;
					for(int j = 0 ; j < ss.length() ; j++){
						if(ss.charAt(j) >= 48 && ss.charAt(j) <= 57){
							isInteger = true;
						}else{
							isInteger = false;
							break;
						}
					}
					if(isInteger){
						ansInt.add(ss);
					}else{
						ansStr.add(ss);
					}
					
				}catch(NullPointerException e){
					ansStr.add(ss);
					//System.out.println("String: "+ss);
				}
			
			}
		}
		
		
		
		if(ansInt.size() > 0){
			System.out.print('"');
			for(int i = 0 ; i < ansInt.size()-1; i++){
				System.out.printf("%s,",ansInt.get(i));
			}
			System.out.print(ansInt.get(ansInt.size()-1));
			System.out.print('"');
		}else{
			System.out.print("-");
		}
		System.out.println("");
		if(ansStr.size() > 0 ){
			System.out.print('"');
			for(int i = 0 ; i < ansStr.size()-1; i++){
				System.out.printf("%s,",ansStr.get(i));
			}
			System.out.print(ansStr.get(ansStr.size()-1));
			System.out.print('"');
		}else{
			System.out.print("-");
		}
		
		
	}

		
	private static void generatePermutation(int n,int at){
		if(n == at){
			String answer= "";
			for(int i = 0 ;i < n ; i++){
				answer += permutatation[i];
			}
			setInteger.add(answer);
			System.out.println(answer);
		}else{
			for(int i = 0 ;i < n ; i++){
				if(!used[i]){
					used[i] = true;
					permutatation[at] = binary[i];
					//System.out.println("permutation[at]: "+permutatation[at]);
					generatePermutation(n, at+1);
					used[i] = false;
				}
			}
		}
	}

	private static class SegmentTree{
		
		
		private int[] tree;
		private int maxSize,height;
		
		
		private final int START = 0;
		private int EndIndex;
		private final int root=0;
	
		private int leftChild(int n){
			return 2*n+1;
		}
		
		private int rightChild(int n){
			return 2*n +2;
		}
		
		private int mid(int a,int b){
			return (a+b)/2;
		}
		
		public SegmentTree(int size){
			height =(int)( Math.ceil(Math.log(size)/Math.log(2)));
			maxSize = 2*(int)Math.pow(2,height)-1;
			tree = new int[maxSize];
			EndIndex = size-1;
		}
		
		
		private int getSum(int startIndex,int endIndex, int queryStart,int queryEnd,int current){
			if(queryStart <= startIndex && queryEnd >= endIndex){
				return tree[current];
			}
			if(endIndex < queryStart || startIndex > queryEnd ) return 0;
			
			int m = mid(startIndex,endIndex);
			
			return getSum(startIndex,m,queryStart,queryEnd,leftChild(current))+
					getSum(m+1,endIndex,queryStart,queryEnd,rightChild(current));
		}
		
		
		private int getSumUntil(int queryStart, int queryEnd){
			if(queryStart < 0 || queryEnd > EndIndex) return -1;
			return getSum(0,EndIndex,queryStart,queryEnd,root);
		}
		
		private int constructing(int[] elements,int start,int end,int current){
			if(start == end){
				tree[current] = elements[start]; 
				return tree[current];
			}
			int m = mid(start,end);
			tree[current] = constructing(elements,start,m,leftChild(current))+
					constructing(elements,m+1,end,rightChild(current));
			return tree[current];
		}
		
		private void ConstructSegmentTree(int[] elements){
			constructing(elements, 0,EndIndex,root);
		}
		
		
		public int[] getTree(){
			return tree;
		}
		
		
	}
	
}