First you look at "how many sub networks you need"?
in this case you need 25
so
2 to the power of what gives you 25 or more but not less
2 to the power of 5
2^5=32 (number of subnets)
you cannot use 2^4 cause it is only 16 which is less than 25
than you can use your default subnet mask for class A (cause your IP is 12.0.0.0 -class A)
and write it in binary:
here
255.0.0.0 -decimal
11111111.00000000.00000000.00000000 - binary
so you need to borrow from hosts (0's) 5 bits
so you will get
11111111.11111000.00000000.00000000
now you can look at the second octet of the subnet mask
it goes like that -128-64-32-16-8-4-2-1
so you can take the last 1 in your subnet mask and compare it to that decimal representation
it is 5 from the left = 8
so your subnet mask are:
12.0.0.0 ------12.7.255.255-this is last one before next one (broadcast)
12.8.0.0
12.16.0.0
12.24.0.0
12.32.0.0
and so on.................
I hope that was helpful
and I hope I am right.