Alex’s uncle is a magician who gave them a magic bag in which coins get doubled each time you put those coins into it. Initially, Alex had few coins with them. So, Alex put all the coins, and the coins got doubled. Alex took out all the coins and gave a few to their friend and then again put the remaining coins back in the bag. The coins doubled again; Alex took out all the coins again and gave a few coins to their second friend. Alex then put the remaining coins in the bag and the coins doubled again. Alex took out all the coins and gave a few coins to their third friend.