#include
#include
struct Node
{
int num;
Node *next;
};
Node *Merge(Node *head1,Node *head2)
{
if(head1==NULL)
return head2;
if(head2==NULL)
return head1;
Node *head=NULL;
if(head1->num
{
head=head1;
head->next=Merge(head1->next,head2);
}
else
{
head=head2;
head->next=Merge(head1,head2->next);
}
return head;
}