There are 3 persons X, Y and Z. On some day, X lent cars to Y and Z as many as they had. After a month Y gave as many cars to X and Z as many as they have. After a month Z did the same thing. At the end of this transaction each one of them had 24. Find the cars each originally had?