head,tail program