#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct queue{

  struct data *top,*rear;
};

int main()
{

  struct queue q;

  q.top = (struct queue)malloc(sizeof(struct queue));
  if(q.top == NULL){printf("メモりが確保できませんでした。\n"); return 1;        }
q.top->key = 'a';
  q.top->next = NULL;
  q.rear = q.top;

  q.top->next = (struct queue)malloc(sizeof(struct queue));
 if(q.top->next == NULL){printf("メモりが確保できませんでした。\n"); return 1;        }
q.top->next->key = 'b';
 q.top->next->next = NULL;
 q.rear = q.top->next;

q.top->next->next = (struct queue)malloc(sizeof(struct queue));
 if(q.top->next->next == NULL){printf("メモりが確保できませんでした。\n"); return 1;        }
q.top->next->next->key = 'c';
 q.top->next->ext->next = NULL;
 q.rear = q.top->next->next;


 
    printf("%c\n", q.top->key);
    printf("%c\n", q.top->next->key);
    printf("%c\n", q.rear->key);
 
    return 0;

}
