  We will prove that in a family of quasi-arithmetic means sattisfying certain
smoothness assumption (embed with a naural pointwise ordering) every finite
family has both supremum and infimum, which is also a quasi-arithmetic mean
sattisfying the same smoothness assumptions. More precisely, if $f$ and $g$ are
$\mathcal{C}^2$ functions with nowhere vanishing first derivative then there
exists a function $h$ such that: (i) $A^{[f]} \le A^{[h]}$, (ii) $A^{[g]} \le
A^{[h]}$, and (iii) for every continuous strictly monotone function $s \colon I
\to \mathbb{R}$
  $$ A^{[f]} \le A^{[s]} \text{ and } A^{[g]} \le A^{[s]} \text{ implies }
A^{[h]} \le A^{[s]}
  $$ ($A^{[f]}$ stands for a quasi-arithmetic mean generated by a function $f$
and so on).
  Moreover $h\in\mathcal{C}^2$, $h'\ne0$, and it is a solution of the
differential equation $$
\frac{h''}{h'}=\max\Big(\frac{f''}{f'},\,\frac{g''}{g'}\Big). $$ We also
provide some extension to a finite family of means.
  Obviously dual statements with inverses inequality sign as well as a
multifuntion generalization will be also stated.
