import java.util.Scanner;
public class Main01 {
static class ListNode {
int val;
ListNode next;
ListNode(){}
ListNode(int val) {
this.val = val;
}
ListNode(int val, ListNode next) {
this.val = val;
this.next = next;
}
}
public static ListNode reverseList(ListNode head) {
if(head == null) {
return null;
}
ListNode pre = null;
while(head != null) {
ListNode next = head.next;
head.next = pre;
pre = head;
head = next;
}
return pre;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] s = sc.nextLine().split(",");
ListNode head = new ListNode(Integer.parseInt(s[0]));
ListNode cur = head;
for(int i = 1; i < s.length; i++) {
cur.next = new ListNode(Integer.parseInt(s[i]));
cur = cur.next;
}
ListNode root = reverseList(head);
while(root != null) {
System.out.print(root.val);
root = root.next;
}
}