Beautiful IP problem