#include <stdio.h>
#include <stdlib.h>
struct node {
int num;
struct node* next;
};
int main() {
int n, i;
scanf("%d", &n);
int a[n], b[n];
struct node *head1 = (struct node*)malloc(sizeof(struct node));//创建两个头指针
struct node *head2 = (struct node*)malloc(sizeof(struct node));
struct node *p1=head1,*p2=head2;//分别保存两个头指针的地址
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);//给第一个数组赋值
head1->next=(struct node*)malloc(sizeof(struct node));//创造节点
head1->next->num=a[i];//将数组中的值赋到节点中去
head1=head1->next;
if(i==n-1) head1->next=NULL;//如果数组中全部值都已经赋到节点中,将最后一个节点的指针初始化
}
for(i=0;i<n;i++){
scanf("%d",&b[i]);
head2->next=(struct node*)malloc(sizeof(struct node));//同理将数组2的值赋到链表2
head2->next->num=b[i];
head2=head2->next;
if(i==n-1) head2->next=NULL;
}
head1=p1;head2=p2;//让头指针重新指向一开始的位置,因为刚才头指针移动了
while(p1->next){
p2->next->num+=p1->next->num;//遍历两个链表,并将第一个链表的值赋到第二个链表中去
p2=p2->next;
p1=p1->next;
}
p2=head2;
while(p2->next){
printf("%d ",p2->next->num);//最后输出即可
p2=p2->next;
}
return 0;
}