A-B problem solution