Imagine a city with vending machines that unlock during earthquakes and other natural disasters, providing free food and supplies.

That is exactly what is happening in the Japanese coastal city of Ako, in Hyogo prefecture, as the country steps up its natural disaster preparations.

On Friday, Japanese news outlet The Mainichi reported that the city had launched a trial run with two emergency vending machines. The machines usually sell snacks and drinks, but will also distribute items for free during major earthquakes or typhoons.

As well as 300 bottles of soda and 150 emergency food items, the lifesaving machines contain lockers filled with essential sanitary items, such as portable toilets and masks, the news outlet said.

The vending machines unlock when an evacuation order is issued after a quake or other natural disasters.