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.io.*;
import java.util.*;
import java.math.*;
 
public class Main{ 
    
    static boolean ONLINE_JUDGE = false;//change before submit
    static Fast f = new Fast();
    static PrintWriter out = new PrintWriter(System.out); 
    static boolean TEST_CASES = false;

    
    static void solve(int TC_NO) {

       String s = rs();
       int n = s.length();

       StringBuilder res1 = new StringBuilder();
       StringBuilder res2 = new StringBuilder();

       int start = 0; 
       int prev = -1;
       boolean flag = true;
       for(int i = 0; i < s.length(); i++){
            if(s.charAt(i)==',' || s.charAt(i)==';'){
                   if(i-prev!=1 && flag && (s.charAt(start)!='0' || (s.charAt(start)=='0' && i==start+1)) ){
                      if(res1.length()==0) res1.append("\""+s.substring(start,i));
                      else res1.append(","+s.substring(start,i));
                   }
                   else {
                       if(res2.length()==0) res2.append("\""+s.substring(start,i));
                       else res2.append(","+s.substring(start,i));
                   }
                 start = i+1;
                 flag = true;
                 prev = i;
                 continue;
            }


           flag &= isDigit(s.charAt(i));

       }
       
       if(prev==n-1){
           if(res2.length()==0) res2.append("\"");
           else res2.append(",");
      }

       else if(prev<n-1){
       
       if(flag && (s.charAt(start)!='0' || (s.charAt(start)=='0' && n==start+1)) ){
            if(res1.length()==0) res1.append("\""+s.substring(start,n));
            else res1.append(","+s.substring(start,n));
       }
       else {
             if(res2.length()==0) res2.append("\""+s.substring(start,n));
             else res2.append(","+s.substring(start,n));
       }
      }

      
        


       if(res1.length()==0) res1.append("-");
       else res1.append("\"");
       if(res2.length()==0) res2.append("-");
       else res2.append("\"");

       out.println(res1);
       out.println(res2);

      /* WARNING : change [ONLINE_JUDGE = false] before SUBMIT */ 
    }

    
    static boolean isDigit(char i){
      return 48<=i && i<=57;
    }

    public static void main(String[] args)throws Exception{

      out = ONLINE_JUDGE? new PrintWriter(new BufferedWriter(new FileWriter("output.txt"))): new PrintWriter(System.out);
      
      if(TEST_CASES){
          
          int t = ri();
          int i = 1;
          while(i<=t){
            solve(i);
            i++;
          }

      }

      else {

        solve(1);
      
      }
      
      out.close();

    }

    static int ri() {

      return f.nextInt();
    
    }

    static long rl() {
 
      return f.nextLong();
    
    }

    static double rd() {

       return f.nextDouble();
    
    }

    static char rc() {
      
       return rs().charAt(0);

    }

    static String rs() {

      return f.next();

    }

    static String rS() {
      
       return f.nextLine();
    
    }

    static int[] ra(int n) {
        
      int[] a = new int[n];
      for(int i = 0;i<n;i++) a[i] = ri();
      return a;
        
    }

    static long[] ral(int n) {
        
      long[] a = new long[n];
      for(int i = 0;i<n;i++) a[i] = rl();
      return a;
        
    }

    static double[] rad(int n) {

      double[] a = new double[n];
      for(int i = 0;i<n;i++) a[i] = rd();
      return a;

    }

    static char[] rac() {

        char[] c = rs().toCharArray();

        return c;

    }
    
    static int[][] rm(int n, int m) {
       
       int[][] mat = new int[n][m];

       for(int i = 0; i < n; i++) mat[i] = ra(m);
       
       return mat;

    }

    static char[][] rmc(int n) {
      
      char[][] cmat = new char[n][];
      
      for(int i = 0; i < n;) cmat[i] = rac();

      return cmat;

    }

    static void sort(int[] a) {

      ArrayList<Integer> list=new ArrayList<>();
      for (int i:a) list.add(i);
      Collections.sort(list);
      for (int i=0; i<a.length; i++) a[i]=list.get(i);

    }

    static String gcc(int TC_NO) {

         return "Case #"+TC_NO+": ";

    }

    static boolean isLetter(char c){

      return (64<c && c<91) || (96<c && c<123);
    
    }
  
    static class Fast{
       public BufferedReader br;
       public StringTokenizer st;
       
       public Fast(){
            try{
                br = ONLINE_JUDGE? (new BufferedReader(new FileReader("input.txt"))):(new BufferedReader(new InputStreamReader(System.in)));
            }
            catch(Exception e){
              throw new RuntimeException(e);
            }
       }
       
       String next(){
            while(st==null || !st.hasMoreTokens()){
                 try{
                      st=new StringTokenizer(br.readLine());
                 }
                 catch(IOException e){
                      throw new RuntimeException(e);
                 }
                 
            }
                 return st.nextToken();
            }
       int nextInt(){
            return Integer.parseInt(next());
       }
   
       long nextLong(){
            return Long.parseLong(next());
       }
   
       double nextDouble(){
            return Double.parseDouble(next());
       }

       String nextLine() 
          { 
              String str = ""; 
              try
              { 
                  str = br.readLine(); 
              } 
              catch (IOException e) 
              { 
                  e.printStackTrace(); 
              } 
              return str; 
          } 
   
    }

    static class MMath {
      
      //O(1)
      static int mod(long a, int m) {
          
         a = a - (a/m) * m;
             
         return a < 0? (int)(a+m): (int)a;

      }
      
      //O(1)
      static long mod(long a, long m){
          
          a = a - (a/m) * m;
             
          return a < 0? (a+m): a;
       
      }
      
      //O(1)
      static int madd(long a, long b, int m) {
            
           a = mod(a,m);
           b = mod(b,m);

           return mod(a+b+2l*m,m);

      }
      
      //O(LOG(a))
      static int mprod(long a, long b, int m) {

            int result = 0;

            while(a>0){

                if(mod(a,2)==1) 
                  result = madd(result,b,m);

                b = madd(b,b,m);
                a = a>>1; 
            }

            return result;

      }
       
      //O(LOG(N)) 
      static int bexpo(int x, int n) {
          
          int result = 1;
          
          while(n>0)
          {
              if(mod(n,2) == 1)
                  result = result * x;
              x = x*x;
              n = n>>1;
          
          }

          return result;
       
      }

      //O(LOG(N))
      static int mexpo(long x, long n, int m) {
        
          int result = 1;
          x = mod(x,m);
          
          while(n>0) {
              if(mod(n,2) == 1)
                  result = mprod(result,x,m);
              x = mprod(x,x,m);
              n = n>>1;
          }

          return result;

      }

      //O(LOG(MAX(A,B)))
      static int gcd(int a, int b){

            while(a!=0 && b!=0){
                 
                 if(a>b) a = mod(a,b);
                 
                 else  b = mod(b,a);
            }

            return a+b;   

      }
      
      //O(LOG(MAX(A,B)))
      static int lcm(int a, int b) {
                 
            return a / gcd(a,b) * b;

      }

      //O(LOG(MAX(A,B)))
      static long gcd(long a,long b){
           
            while(a!=0 && b!=0){
                 
                 if(a>b) a = mod(a,b);
                 
                 else  b = mod(b,a);
            }

            return a+b;   
        
      } 

      //O(LOG(MAX(A,B)))
      static long lcm(long a, long b) {
                 
            return a / gcd(a,b) * b;

      }

      /*Used to solve ax+by=gcd(a,b) */
      static int d, x0, y0;//global or static 
      static void extendedEuclid(int a, int b) {
        
        if(b == 0) {
            d = a;
            x0 = 1;
            y0 = 0;
        }
        else {
            extendedEuclid(b, mod(a,b));
            int temp = x0;
            x0 = y0;
            y0 = temp - (a/b)*y0;
        }
      
      }
      
      //O(LOG(MAX(A,B)))
      static int[] eeuclid(int a, int b) {
          
          extendedEuclid(a,b);

          return new int[]{d,x0,y0};

      }

      //modular multiplicative Inverse exists only when A and M are Co-prime
      //O(LOG(MAX(A,M)))
      static int modInverse(int a, int m) {

         extendedEuclid(a,m);

         return mod(x0,m);
             
      }

      //MMI using FLT (applied only when m is prime)
      //O(LOG(M))
      static int modInversePrime(int a,int m) {

            return mexpo(a,m-2,m);

      }

    }

}