#include<stdio.h>
//#include<string.h>

struct data{
  char key;
  struct data *next;
};
 
  int main()
  {
 
    struct data *top;
 
    top = (struct data*)malloc(sizeof(struct data));
    if(top == NULL){printf("メモりが確保できませんでした。\n"); return 1;     }
    top->key = 'a';
    top->next = (struct data*)malloc(sizeof(struct data));
    if(top->next == NULL){printf("メモりが確保できませんでした。\n"); return 1;        }
 
 
//    top = top->next;
    top->next->key = 'b';
    top->next->next = (struct data*)malloc(sizeof(struct data));
    if(top->next->next == NULL){printf("メモりが確保できませんでした。\n"); 
      return 1;     }
//    top = top->next->next;
 
    top->next->next->key = 'c';
    top->next->next->next = NULL;
 
 
 
 
    printf("%c\n", top->key);
    printf("%c\n", top->next->key);
    printf("%c\n", top->next->next->key);
 
 
    return 0;
 
  }
