2. tested on 'UVA-10679-I_love_Strings!!!' problem