Finding suspect coin out of 12

Problem statements:
I have 12 coins. One is bad coin (heavy or light). You need to find it.
You are allowed to use "weighing Balance" for three times.
S- Suspect
G- good
H- heavy
L- Light
== Compare


S S S S S S S S S
S S S


S S S S == S S S S

case 0
weigh same

G S1 == G S2
S2 == G

case 1
if Heavy light
H H H H L L L L G G G G

Compare H1 H2 , L3 === S1 L2 H3
{
1. if left side goes down then Either H1/H2 is heavy or L2 is light i.e. HHL
2. if left side goes up either L1 is light or H3 is heavy
3. if eaual, the remaining, either H4 is heavy or L3/L4 is light i.e LLH
}


Finally: If the case is LLH

L1==L2 if both are same suspect H
if one is light suspect the light.