solve pe97 problem