added code for Uva: 11286