/*
class IntStack{
int max; // 스택 용량
int ptr; // 스택 포인터
int[] stk; // 스택의 본체
public IntStack(int capacity) {
int ptr =0;
int max = capacity;
try {
stk = new int[max];
}catch(OutOfMemoryError e) {
max = 0;
}
}
public class EmptyIntStackException extends RuntimeException{
public EmptyIntStackException() {
}
}
public class OverflowIntStackException extends RuntimeException{
public OverflowIntStackException() {
}
}
public int push(int x) throws OverflowIntStackException{
if(ptr>=max)
throw new OverflowIntStackException();
return stk[ptr++] = x;
}
public int pop() throws EmptyIntStackException{
if(ptr<=0)
throw new EmptyIntStackException();
return stk[--ptr];
}
public int peek() throws EmptyIntStackException{
if(stk[ptr]<=0)
throw new EmptyIntStackException();
return stk[ptr-1];
}
public int indexOf(int i) {
for(int j=ptr-1 ; j>=0; j --) {
if(stk[j]==i) {
return j;
}
}
return -1;
}
public void clear() {
ptr = 0;
}
public int capacity() {
return max;
}
public int size() {
return ptr;
}
public boolean IsEmpty() {
if(ptr==0) {
return true;
}
return false;
}
public boolean IsFull() {
if(ptr==max) {
return true;
}
return false;
}
public void dump() {
if(ptr!=0) {
for(int j = ptr-1 ; j >=0; j--) {
System.out.println(stk[j]);
}
}else {
System.out.println("스택이 비어있습니다.");
}
}
}
*/
// 2016 : 천단위 구분 기호 문제
import java.util.*;
class intStack{
int max;
int ptr;
int[] stk;
public intStack(int capacity) {
ptr = 0;
max = capacity;
try {
stk= new int[max];
}
catch(OutOfMemoryError e) {
max =0;
}
}
public void push(int x) {
if(ptr>=max) {
throw new OverflowIntStackException();
}
stk[ptr++] = x;
}
public class OverflowIntStackException extends RuntimeException{
public OverflowIntStackException() {
}
}
public void finish() {
for(int i=ptr-1; i>=0; i--) {
if(i%3==2)
System.out.print(',');
System.out.print(stk[i]);
}
}
}
public class Main{
Scanner scan = new Scanner(System.in);
public Main() {
int n= 8;
//int n = scan.nextInt();
intStack s = new intStack(n);
String arr = scan.nextLine();
char[] arr1 = new char[n];
arr1 = arr.toCharArray();
for(int i=0; i<n; i++) {
//System.out.println(arr1[i]);
s.push(Character.getNumericValue(arr1[i]));
}
s.finish();
}
public static void main(String[] args) {
new Main();
}
}
/*
import java.util.*;
class IntStack{
int max;
int ptr;
int[] stk;
public IntStack(int capacity) {
int ptr = 0;
int max = capacity;
try {
stk = new int[max];
}catch(OutOfMemoryError e) {
max = 0;
}
}
public class EmptyIntStackException extends RuntimeException{
public EmptyIntStackException() {
}
}
public class OverflowIntStackException extends RuntimeException{
public OverflowIntStackException() {
}
}
public int push(int x) throws OverflowIntStackException {
if(ptr>=max) {
throw new OverflowIntStackException();
}
return stk[ptr++] = x;
}
public int top() {
if(ptr<=0)
return -1;
return ptr;
}
public int pop() throws EmptyIntStackException{
if(ptr<=0)
throw new EmptyIntStackException();
return stk[ptr--];
}
public int size() {
return ptr;
}
public boolean empty() {
if(ptr==0)
return true;
return false;
}
}
public class Main{
public Main() {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int i=0;
IntStack s = new IntStack(x);
}
public static void main(String[] args) {
new Main();
}
}
*/