Inflation cools to 3.1% in April