Planck 2018 results. X. Constraints on inflation