The SIDs are normally named from the point that they terminate.
Example:
SAM 3P from 08R at Gatwick. SID terminates at SAM is currently on revision 3, (changed from a 2 last year due to a change in turning point) and the P is the designator for a 08R SID.
Likewise all 26L SIDs end in an M
You can work the LAM 4M out for yourselves!