他山の石以て玉を攻むべし(たざんのいしもってたまをおさむべし)

Japanese vocabulary

Meaning: one should learn from other's mistakes; stones from other mountains can be used to polish one's own gems

See it used in real works