{
    "Nitrogen Compounds": {
        "Aliphatic Amines": "[NX3&!$(N[C,S]=[O,S,N])&!$(N=*)&!$(N#*)&!$(N[a,N,S,O,P,Cl,F])]",
        "Amide": "[N&$(N-C=O)&!$(N-[N,S,P])]",
        "Aromatic Nitrogen Heterocycles": "[n]",
        "Total Nitrogen": "[N,n]"
    },
    "Oxygen Compounds": {
        "Oxygen Heterocycles": "[O&R,o&R]",
        "Ethers": "[#6&!$([#6]=[O,N,S])][O;D2][#6&!$([#6]=[O,N,S])]",
        "Esters": "[CX3](=O)[OX2H0][#6]",
        "Total Oxygen": "[O,o]"
    },
    "Sulfur Compounds": {
        "Sulfur Heterocycles": "[S&R,s&R]",
        "Thioethers": "[C,c][S;D2][C,c]",
        "Sulfonamides": "[C,c][S](=[O])(=[O])[N]",
        "Total Sulfur": "[S,s]"
    }
}