Binding Geometry of Hydrogen-Bonded Chain Motif in Self-Assembled Gratings and Layers on Ag(111)