You can treat a ring magnet as two concentric solenoids (with currents in opposite directions), and a cylindrical magnet as a solenoid. Each can be treated as a magnetic dipole, and if the cylinder is far enough from the other two you can add the forces on its magnetic dipole from the fields from the two concentric solonoids, or use the force due to the sum of the two fields.