#include<iostream>#include<string.h>#include<stdio.h>using namespace std;enum { SIZ = 104,};int avail[] = { 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, };int tab[] = { 0, 2, 4, 6, 30, 32, 34, 36, 40, 42, 44, 46, 50, 52, 54, 56, 60, 62, 64, 66, };int tsize = sizeof(tab)/sizeof(tab[0]);unsigned int no;char buf[10];void fun(){ int pos = 0; long long num = tsize; while(no >= num){ ++pos; while(!avail[pos]){ ++pos; } num *= (tsize); } string s; long long base, a; while(pos > 0){ base = num / (tsize); a = no / base; if (s.empty()){ sprintf(buf, "%d,", tab[a]); } else { sprintf(buf, "%03d,", tab[a]); } s += buf; no %= base; num /= (tsize); --pos; while(!avail[pos]){ s += "000,"; --pos; } } a = no; if (s.empty()){ sprintf(buf, "%d", tab[a]); } else { sprintf(buf, "%03d", tab[a]); } s += buf; printf("%sn", s.c_str());}int main(){ scanf("%d", &no); while(no){ fun(); scanf("%d", &no); } return 0;}