added code for Uva: 10126