while(p->next)p=p->next;