The principle allows a person who is usually mad but occasionally lucid to make a valid contract during the periods when they are not mad. A is described as generally mad but rarely capable of understanding things, meaning there are, at least sometimes, moments when A can understand. Let's check each option against this principle.
Since A does have rare periods of being capable of understanding, the principle allows A to make a valid contract during those periods.
Therefore, the correct answer is A can make a contract.
The principle can be framed as a conditional rule: if a person is usually mad but has periods, however rare, when they are not mad, then a contract entered into during one of those specific lucid periods is valid; the rule attaches to the state of mind at the moment of contracting, not to the person's general condition or to their own preference of timing. The facts tell us A generally remains mad but rarely becomes capable of understanding, which confirms lucid periods exist for A, just infrequently. Let's test each option against this conditional.
Since the facts confirm A does have rare lucid periods, the rule's condition for a valid contract is met during those periods, without any of the added restrictions the other options introduce.
Therefore, the correct answer is A can make a contract.