added code for Uva:727