A*B problem