  Let $H$ be a complete $r$-uniform hypergraph such that two vertices are
marked in each edge as its `boundary' vertices. A linear ordering of the vertex
set of $H$ is called an {\em agreeing linear order}, provided all vertices of
each edge of $H$ lie between its two boundary vertices. We prove the following
Helly-type theorem: if there is an {agreeing linear order} on the vertex set of
every subhypergraph of $H$ with at most $2r-2$ vertices, then there is an
agreeing linear order on the vertex set of $H$. We also show that the constant
$2r-2$ cannot be reduced in the theorem. The case $r=3$ of the theorem has
particular interest in the axiomatic theory of betweenness. Similar results are
obtained for further $r$-uniform hypergraphs ($r\geq 3$), where one or two
vertices are marked in each edge, and the linear orders need to satisfy various
rules of agreement. In one of the cases we prove that no such Helly-type
statement holds.
