On Monday morning, a shopkeeper sold 1/3 of the amount of rice he had.

He sold another 10 kg of rice in the afternoon. On Tuesday, he sold 1/3 of
the remainder of rice. On Wednesday, he sold 44 kg and had 4 kg of rice
left. How many kilograms of rice did the shopkeeper have at first?

Monday: sold 1/3 x+10, leaving 2/3 x - 10

Tuesday: sold 1/3 (2/3 x - 10) = 2/9 x - 10/3
Wednesday: sold 44, leaving 4
so,
(1/3 x+10) + (2/9 x - 10/3) + 44 + 4 = x
x = 123 kg