#include<iostream>
using namespace std;
template<typename T>
class Pair
{
public:
T pair1,pair2;
Pair(T i,T j):pair1(i),pair2(j){}
template<typename T1>Pair<T>& operator=(Pair<T1>&);
};
template<typename T>
template<typename T1>
Pair<T>& Pair<T>::operator=(Pair<T1>& temp)
{
this->pair1 =temp.pair1*10;//At this point
this->pair2=temp.pair2;
return *this;
}
int main()
{
Pair<int>P1(10,20);
Pair<int>P2(1,2);
const Pair<int>& x = P1;
P2=x;
cout<<P2.pair1<<' '<<P2.pair2<<endl;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPgpjbGFzcyBQYWlyCnsKICAgIHB1YmxpYzoKICAgICAgICAgICAgVCBwYWlyMSxwYWlyMjsKICAgICAgICAgICAgUGFpcihUIGksVCBqKTpwYWlyMShpKSxwYWlyMihqKXt9CiAgICAgICAgICAgIHRlbXBsYXRlPHR5cGVuYW1lIFQxPlBhaXI8VD4mIG9wZXJhdG9yPShQYWlyPFQxPiYpOyAgICAgICAgICAgICAKfTsKCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CnRlbXBsYXRlPHR5cGVuYW1lIFQxPgpQYWlyPFQ+JiBQYWlyPFQ+OjpvcGVyYXRvcj0oUGFpcjxUMT4mIHRlbXApCnsKCiAgICB0aGlzLT5wYWlyMSA9dGVtcC5wYWlyMSoxMDsvL0F0IHRoaXMgcG9pbnQKICAgIHRoaXMtPnBhaXIyPXRlbXAucGFpcjI7CiAgICByZXR1cm4gKnRoaXM7Cn0KCmludCBtYWluKCkKewoKICAgIFBhaXI8aW50PlAxKDEwLDIwKTsKICAgIFBhaXI8aW50PlAyKDEsMik7CiAgICBjb25zdCBQYWlyPGludD4mIHggPSBQMTsKICAgIFAyPXg7CiAgICBjb3V0PDxQMi5wYWlyMTw8JyAnPDxQMi5wYWlyMjw8ZW5kbDsKICAgIHJldHVybiAwOwp9