"Thirty years in Hedong, thirty years in Hexi" is a folk proverb, which comes from the fact that the Yellow River was not fixed in the past and often changed its course (it happened countless times in history). A place used to be on the east side of the river, but in a few years, due to the diversion of the Yellow River, this place will become on the west side of the river. This sentence is a metaphor for the ups and downs of personnel, which is changeable and sometimes becomes the opposite and unpredictable. This is an early use case:
Chapter 46 of Qing Wu's Scholars: "Mr. Da, thirty years in Hedong, thirty years in Hexi. Just like thirty years ago, I saw with my own eyes how magnificent your two houses were. Now, Peng Jia and Fang Jia are getting better every year.