Added code for Uva:642