import java.util.*;

public class Give {

	public static String [] digits = {"00", "02", "04", "06", "30", "32", "34", "36", "40", "42",
			   "44", "46", "50", "52", "54", "56", "60", "62", "64", "66"};
	public static String []zeroes = {"", "0", "0", "0", "0", "0", "0", "0000000", "0"};

	public static void main(String [] args)
	{
		Scanner in = new Scanner(System.in);
		int n;

		n = in.nextInt();
		while (n > 0) {
			String ans = "";
			int k=0;
			while (n > 0) {
				int i = n%20;
				ans = digits[i] + zeroes[k] + ans;
				n /= 20;
				k++;
			}
			while (ans.charAt(0) == '0')
				ans = ans.substring(1);
//			System.out.println(ans);
											// add commas
			k=ans.length()-3;
			while (k>0) {
				ans = ans.substring(0,k)+","+ans.substring(k);
				k -= 3;
			}
			System.out.println(ans);

			n = in.nextInt();
		}
	}
}