Complex sentence: Bells ring in the midst of fluttering flags, which are used to pray in the shrine.
Split into simpler sentences: Bells ring in the midst of fluttering flags. These flags are used to pray in the shrine.