Below is an instruction that describes a task. Write a response that appropriately completes the request in Swahili. Please answer in Swahili.

### Instruction:
Tim has some cans of soda. Jeff comes by, and takes 6 cans of soda from Tim. Tim then goes and buys another half the amount of soda cans he had left. If Tim has 24 cans of soda in the end, how many cans of soda did Tim have at first?

### Response:
 Hebu x iwe idadi ya makopo Tim aliyokuwa nayo mwanzoni.
Baada ya Jeff kuja, Tim ana makopo x-6 yaliyobaki.
Tim ananunua makopo mengine (x-6)/2.
x-6+(x-6)/2=24
2*x-12+x-6=48
3*x-18=48
3*x=66
x=<<22=22>>22