#include <stdio.h>
#include <stdlib.h>

struct list 
{
   int a;
   struct list *next;
};
typedef struct list List;

int main (void)
{
   List *start = NULL, **end = &start;
   int a;
   while(scanf("%d", &a) == 1) {
      List *node = (List*)malloc(sizeof(List));
      node->a = a;
      node->next = NULL;
      *end = node;
      end = &node->next;
   }
   List *current = start;
   while(current) {
      printf("%d --> ", current -> a);
      current = current -> next;
   }
   current = start;
   while(current) {
      List *toDelete = current;
      current = current -> next;
      free(toDelete);
   }
   return 0;
}

