added code for Uva:101: