Bicycles are useful for all sorts of things — namely transportation and exercise. But in Brazil, enterprising prison officials have figured out a way to use them for electric power production.

Stealing the name conEdison would be apropos, as the prison uses four inmate powered bicycles to light up a riverfront promenade in the nearby town. Best of all they're using a carrot-on-stick approach to getting inmates interested in playing along.

Inmates in the medium security prison near Santa Rita do Sapucai, a small city a couple hours north of São Paulo, have the option of early release if they spend enough time in the saddle, pedaling to recharge a car battery. Three eight hour shifts equals one day off of a sentence.

It's not a complicated system. The power-generating bikes, donated by the municipal police department from its stock of lost and found bicycles, juice the car battery, which is then driven into town by a guard at sundown and connected to the promenade's 10 street lamps through a converter donated by local businesses. Another guard drives the battery back to the prison in the morning.

The program has already begun to spread around the country, but it started with a local judge, who read a story about gyms in the U.S. using exercise bikes to generate electricity. The promenade, previously unlit at night, has seen an uptick in the number of nighttime visitors since inmate-supplied power began lighting them. Officials hope to add more bikes and batteries, to light all 34 of the walkway's lights at night.

"It's a win-win situation," Gilson Rafael Silva, the prison's director, told the Associated Press. "People who normally are on the margins of society are contributing to the community and not only do they get out sooner in return, they also get their self-esteem back."