Two trolleys of mass m and 3m are attached by a spring. The spring was compressed and then released