Three friends say they are friends A,B and C and they want to buy a teacher a gift so they each put in $10($30 total) and a fourth friend say he is friend D and uses the money and buys a $25 gift and has $5 left and gives each of the three friends $1 back so they technically used $9 each but 9x3=27 and there is $2 left from the $5 but 27+2=29 so when is the last dollar like how does this work?