As per Newton's II law we know that
[tex]F_{net} = ma[/tex]
here for the first case we know that
[tex]F_{net} = 12 N[/tex]
m = 3 kg
now we will have
[tex]12 = 3\times a[/tex]
[tex]a = 4 m/s^2[/tex]
now for other case we will have
m = 6 kg
now we have
[tex]12 = 6 \times a[/tex]
[tex]a = 2 m/s^2[/tex]