#include<stdio.h>
#include<stdlib.h>
typedef struct listnode{
int data;
struct listnode* next;
}listnode;
listnode* createtree(int n){
listnode* head=(listnode*)malloc(sizeof(listnode));
head->next=NULL;
listnode *p=head;
while(n--){
int data;
scanf