#include <iostream>
using namespace std;
template <class T>
void swap(T *a, T *b) {
T t = *a;
*a = *b;
*b = t;
}
template <typename T1, typename T2>
void print2(T1 t1, T2 t2) {
cout << t1 << ' ' << t2 << endl;
}
int main() {
int a = 100;
int b = 999;
print2(a, b);
swap(&a, &b);
print2(a, b);
char c = 'C';
char d = 'D';
print2(c, d);
swap(&c, &d);
print2(c, d);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdGVtcGxhdGUgPGNsYXNzIFQ+IAp2b2lkIHN3YXAoVCAqYSwgVCAqYikgewoJVCB0ID0gKmE7CgkqYSA9ICpiOwoJKmIgPSB0Owp9Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVDEsIHR5cGVuYW1lIFQyPgp2b2lkIHByaW50MihUMSB0MSwgVDIgdDIpIHsKCWNvdXQgPDwgdDEgPDwgJyAnIDw8IHQyIDw8IGVuZGw7Cn0KCmludCBtYWluKCkgewoKCWludCBhID0gMTAwOwoJaW50IGIgPSA5OTk7CglwcmludDIoYSwgYik7Cglzd2FwKCZhLCAmYik7CglwcmludDIoYSwgYik7CgoJY2hhciBjID0gJ0MnOwoJY2hhciBkID0gJ0QnOwoJcHJpbnQyKGMsIGQpOwoJc3dhcCgmYywgJmQpOwoJcHJpbnQyKGMsIGQpOwoJCglyZXR1cm4gMDsKfQ==