A Shanghai middle school has some seriously big neighbours.
On one side, a cluster of towering residential apartment buildings crowd in, their occupants looking down from high above the campus of Shanghai No 2 Middle School Affiliated to Tongji University.
On the other side, the buzz of cars, motorbikes and heavy traffic jamming a network of arterial roads fills the air.
And, surrounding it all, a staggering 24 million people go about their daily lives in China’s largest metropolis.
The competition for space meant that when the school’s campus was recently redeveloped, there was only one way left to go - up.
As a result, its gleaming new classrooms, science laboratories and modern library now occupy their own multi-level block.
Elsewhere, there is space only for small outdoor courtyards and a running track, built in the shadows of the towers.
For a city on the edge of the Pacific Ocean, the surf can seem a long way away.
Which perhaps explains part of the appeal of an empty Dunedin beach when imagined from a city of such extraordinary scale.
The Otago Daily Times (ODT) visited Shanghai recently to better understand the seemingly David-and-Goliath relationship between the two sister cities.
Shanghai, a global financial hub, is home to the world’s busiest port, a gleaming new metro transport system, and - in the 632m, 128-storey Shanghai Tower - the world’s second tallest building.
Dunedin, the Edinburgh of the South, is home to Victorian and Edwardian architecture, penguins and albatross.
But when the ODT visited Shanghai No 2 Middle School Affiliated to Tongji University, the enthusiasm for Dunedin was obvious.
The school, which has a strong science focus, has for four years sent an annual delegation of 12 pupils and a teacher to Dunedin for two weeks.
The pupils are hosted by Kaikorai Valley College, billeted with Dunedin families and spend part of their time at the University of Otago.
School director Dong Yanan said the Dunedin experience offered her pupils a unique chance to experience another culture and a different way of life.
But it also gave them a chance to get up close with nature while tackling research projects in the field.
"The students can be very close to nature, because they can do the experiments by the sea.
"This is so different from ours [Shanghai’s environment].
"Now they can do that. They can realise that," she said.
The opportunity fostered fierce competition between pupils, whose academic results and feedback from teachers were assessed as part of the selection process.
"We need to choose the best ones - the best performers,’ she said.
Another, Gu Zhenhao, also enjoyed trips to the beach and the cultural exchanges that followed.
"Before I went to New Zealand I only knew the sheep.
"I talked a lot about Chinese culture with my host family and they told me a lot about Dunedin."
School staff member Zhu Xiaoyan said it was an invaluable experience for pupils and the school.
"They really can learn something from each other.
"For the school, the development of the students is our aim, our mission, right? That is why we continue the programme."
Pupils were also required to keep a diary in Dunedin, and report back to the rest of the school on their experiences when they returned to Shanghai.
"This experience I think can stay with them their whole life.
"Thank you, for your side, to give us a chance," she said.
But Shanghai No 2 Middle School Affiliated to Tongji University is not alone - far from it.
Across Shanghai, schools, universities and other institutions were benefiting from exchanges with their contemporaries in Dunedin.
At least five educational institutions in Shanghai have established relationships with Otago Polytechnic - from the Shanghai University of Engineering Science to the Shanghai Art and Design Academy.
The University of Otago also hosted students as well as collaborating on research, including in the field of non-communicable diseases.
It has also launched a new doctorate in business administration, taught by Otago lecturers, at Shanghai’s Jiaotong University and in Dunedin.
The course, a New Zealand first, attracted Chinese businessmen and women from large firms, including the Bank of China’s human resources vice-president.
And, as primary and high schools from both cities swapped pupils and teachers, the relationship was evident in other ways, too.
Institutions like Otago Museum had developed their own links, while business leaders looked to establish or expand opportunities in both cities.
Those economic opportunities included the rise of China-based e-commerce giant Alibaba, which now stocked more than 400 New Zealand brands, including fresh milk from Fonterra, and kiwifruit.
In one of the company’s new Hema smart retail stores, for example, diners could order online or eat in, selecting from produce including live crayfish from New Zealand swimming in tanks.
Those eating in-store could even have their meals delivered by robot waiters, paid for by flashing a smartphone.
On a civic level, the Dunedin City Council and Enterprise Dunedin have also signed key friendship agreements and memorandums of understanding with institutions in Shanghai, as well as other parts of China.
That included with the Shanghai Science & Technology Commission, to foster research links, the Shanghai Arts & Film Federation, to promote Dunedin as a location, and the Shanghai Media Group, helping build connections between it and Dunedin-based NHNZ.
The Dunedin Mayoral Scholarship also supported Shanghai students to study in Dunedin, and Enterprise Dunedin was building links between Dunedin tourism agents and tourism businesses in Shanghai.
Even Dunedin's Chinese Garden, Lan Yuan, was expanding its relationship with its sister garden in Shanghai, the Yu Yuan Garden.
Lu Lili, the deputy director of the Shanghai Municipal Education Commission’s international co-operation and exchange division, said education was a key area of focus.
Dunedin’s strong educational institutions and the international reputation they enjoyed was part of the appeal.
So, too, was the friendly welcome international students received in Dunedin, and Dunedin’s willingness to invest in the relationship by sending regular delegations to Shanghai, Ms Lu said.
"We feel very impressed by Dunedin city. Every year you will have the very high-level mission to visit Shanghai and maintain the relationship.
"Even if sometimes we don’t have a very big change compared with previous years ... just to review what we have done is really making people feel like it’s a long-cherished friendship.
"I personally feel it’s not like a factory to produce things very quickly. Sometimes it is a kind of [way to] maintain the relations ... to showcase your sincerity to value this relationship."
Another example of recent collaboration was found at the Shanghai University of Engineering Science, home to 25,000 students across three campuses.
Xiaoming Zhou, the dean of the university’s Sino-French Institute of Fashion Designer programme, said it had links to more than 80 other institutions across the world, but Otago Polytechnic was considered "one of our best".
Shanghai students had in recent years been travelling to Dunedin to study and participate in the iD Fashion Show, including an annual visit by models studying towards a bachelor of fashion performance and planning degree.
"This collaboration is not just a collaboration between two [institutions]. It has contributed a lot to the education and cultural exchanges between two countries," she said, speaking through a translator.
But the flow went both ways, as Shanghai played host to the 10th annual Shanghai Sister Cities Summer Camp programme, where Dunedin students were among 140 from 25 countries, earlier this year.
There was potential for more growth, too, as schools and institutions in Shanghai looked for opportunities to expand contacts with Dunedin.
Ms Lu, of the education commission, said Shanghai’s universities previously had four strategic roles - research, the cultivation of talents, culture and heritage, and serving the community.
A fifth had now been added - international exchanges.
"This is one of the main policies for our universities. Each university, they have the responsibility to fulfil this role, either through student exchange or teachers or research.
"It depends on what kind of common areas they can find."
That expanding focus was part of a broader change within China, which had, since 1978, been "opening up" to the world through economic reforms.
The reforms had helped transform China into the world’s second-largest economy, behind only the United States, and lifted 800 million people out of poverty.
Shanghai has been at the forefront of those reforms, as initiatives like a new free trade zone covering the Pudong district - now home to the city’s tallest skyscrapers - encouraged foreign investment.
Liu Weidong, the director of the press division at the Shanghai Municipal Foreign Affairs Office, said - like Dunedin - Shanghai was thinking big.
Dunedin wanted to be a great small city, while Shanghai aimed to be a "outstanding global city" by 2035, he said.
Research and development, and technological innovation, was a key part of that plan, as was international collaboration, he said.
"We think we will have to learn from advanced countries and cities like Dunedin and like New Zealand.
"It is quite important for [Shanghai] as well as for the nation."
• The ODT travelled to Shanghai with assistance from the Chinese Consulate-General in Christchurch.