We consider a class of toy models where a spatially flat universe is filled with a perfect fluid. The dynamics is found exactly for all these models. In one family, the perfect fluid is of the phantom type and we find that the universe is first contracting and then expanding while the dynamics is always accelerated. In a second family, the universe is first in an accelerated expansion stage, then in a decelerated expansion stage until it reaches a turning point after which it contracts in a decelerated way (increasing contraction rate) followed by another accelerated stage (decreasing contraction rate). We also consider the possibility to embed this perfect fluid in a realistic cosmology. The first family cannot be viable in a conventional big bang universe and requires a rebound in the very early universe. The second family is viable in the range $0<1+w_{DE,0}lesssim 0.09$ for a spatially closed universe with a curvature satisfying current bounds. Though many of the models in this family cannot be distinguished today from a universe dominated by a cosmological constant, the present accelerated expansion is transient and these universes will reach a turning point in the future before entering a contraction phase.