  A complex polynomial $P(z) = c_0 + c_1 z +...+ c_n z^n$ is called unimodular
if $|c_j| = 1$, $j = 0,...,n$. Littlewood asked the question (1966) on how
close a unimodular polynomial come to satisfying $|P(z)| \approx \sqrt{n+1}$ if
$n \ge 1$? In this paper we show that for a given $0 < a < b$ and $\eps > 0$
there exist trigonometric sums $\cP(t) = n^{-1/2} \sum_{j=0}^{n-1} \exp(2\pi i
t\omega(j))$ with a real frequency function $\omega(j)$ which are $\eps$-flat
on segment $[a,b]$ acording to the norm in $L^1([a,b])$ (as well as in
$L^2([a,b])$). We apply this method to construct a dynamical system having
simple spectrum and Lebesgue spectral type in the class of rank-one flows.
