#include <iostream>
using namespace std;
template<class AB,class BA>
void mirror(const AB& ab,BA& ba){
ba = ab;
}
template<class A,class B,class C,class D>
void mirror(const pair<A, B>& a, pair<C, D>& b){
mirror(a.first, b.second);
mirror(a.second, b.first);
}
int main(){
pair<int,float> ab;
ab.first=3;
ab.second=2.0;
pair<float,int> ba;
mirror(ab,ba);
printf("%d\n",ba.second);
pair<pair<int,float>,pair<float,int> > ab_cd;
ab_cd.first.first=4;
pair<pair<int,float>,pair<float,int> > dc_ba;
mirror(ab_cd,dc_ba);
printf("%d\n",dc_ba.second.second);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdGVtcGxhdGU8Y2xhc3MgQUIsY2xhc3MgQkE+CnZvaWQgbWlycm9yKGNvbnN0IEFCJiBhYixCQSYgYmEpewogICAgYmEgPSBhYjsKfQp0ZW1wbGF0ZTxjbGFzcyBBLGNsYXNzIEIsY2xhc3MgQyxjbGFzcyBEPgp2b2lkIG1pcnJvcihjb25zdCBwYWlyPEEsIEI+JiBhLCBwYWlyPEMsIEQ+JiBiKXsKICAgIG1pcnJvcihhLmZpcnN0LCBiLnNlY29uZCk7CiAgICBtaXJyb3IoYS5zZWNvbmQsIGIuZmlyc3QpOwp9CgppbnQgbWFpbigpewogICAgcGFpcjxpbnQsZmxvYXQ+IGFiOwogICAgYWIuZmlyc3Q9MzsKICAgIGFiLnNlY29uZD0yLjA7CiAgICBwYWlyPGZsb2F0LGludD4gYmE7CiAgICBtaXJyb3IoYWIsYmEpOwogICAgcHJpbnRmKCIlZFxuIixiYS5zZWNvbmQpOwogICAgCiAgICBwYWlyPHBhaXI8aW50LGZsb2F0PixwYWlyPGZsb2F0LGludD4gPiBhYl9jZDsKICAgIGFiX2NkLmZpcnN0LmZpcnN0PTQ7CiAgICBwYWlyPHBhaXI8aW50LGZsb2F0PixwYWlyPGZsb2F0LGludD4gPiBkY19iYTsKICAgIG1pcnJvcihhYl9jZCxkY19iYSk7CiAgICBwcmludGYoIiVkXG4iLGRjX2JhLnNlY29uZC5zZWNvbmQpOwoKICAgIHJldHVybiAwOwogICAgCn0=