Illustration of experimental design. a, Timeline of trials. Illustrated is the task from the perspective of the responder: first, a blank screen is presented for 500–1500 ms (mean, 1000 ms) in the color of the proposer group (L, M, or H); second, a panel containing the photographs of the proposer group was added for 1500 ms; and third, the proposal was then shown for 3000 ms (denoted both numerically and visually by the height of the coin stacks) along with the instruction to accept or reject (side counterbalanced between subjects). Subjects understood that the silhouette represented the other subject attending that session, who had been placed in one of the three proposer groups. During the 3000 ms in which the proposal was shown, subjects had to decide by a button press whether to accept or reject the offer. Subjects saw a brief screen with “REST” displayed every eight to nine contiguous trials before an introductory screen announced the group or groups whose offers would be presented next (i.e., M group only; M and H groups; M and L groups). b, Order of conditions. Initially, in a reputation learning session performed outside the scanner, subjects responded to the full set of 25 offers from the M proposer group alone (gray), the 25 H offers alone (white), and the 25 L offers alone (black). Subjects then underwent the main testing session in the scanner or behaviorally, which comprised three runs. In each run of 125 trials, subjects responded to the M set of offers in three contexts: alone (neutral), interleaved with the L set (M-in-L; more fair), and interleaved with the H set (M-in-H; less fair).