#include <iostream>
#include <netinet/in.h>
using namespace std;
int main() {
auto i = htons(12345);
cout << i << endl;
i = ntohs(i);
cout << i << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bmV0aW5ldC9pbi5oPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJYXV0byBpID0gaHRvbnMoMTIzNDUpOwogICAgY291dCA8PCBpIDw8IGVuZGw7CiAgICAKICAgIGkgPSBudG9ocyhpKTsKICAgIGNvdXQgPDwgaSA8PCBlbmRsOwogICAgCglyZXR1cm4gMDsKfQ==