import java.util.Arrays;
public class Ip {
%% machine ip;
%% write data;
public static void main
(final String[] args
) { int p = 0;
char[] data = args[0].toCharArray();
int pe = data.length;
int eof = pe;
int cs;
int[] ip = new int[4];
int pos = 0;
%%{
write init;
action add {
ip[pos] = ip[pos] * 10 + (fc - '0');
}
action next {
++pos;
}
dec_octet = (digit |
[1-9] . digit |
"1" . digit . digit |
"2" . ([0-4] . digit| "5" . [0-5]) ) $add;
main := dec_octet ("." @next . dec_octet){3};
write exec;
}%%
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheXM7CgpwdWJsaWMgY2xhc3MgSXAgewogICAgJSUgbWFjaGluZSBpcDsKICAgICUlIHdyaXRlIGRhdGE7CgogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oZmluYWwgU3RyaW5nW10gYXJncykgewogICAgICAgIGludCBwID0gMDsKICAgICAgICBjaGFyW10gZGF0YSA9IGFyZ3NbMF0udG9DaGFyQXJyYXkoKTsKICAgICAgICBpbnQgcGUgPSBkYXRhLmxlbmd0aDsKICAgICAgICBpbnQgZW9mID0gcGU7CiAgICAgICAgaW50IGNzOwogICAgICAgIGludFtdIGlwID0gbmV3IGludFs0XTsKICAgICAgICBpbnQgcG9zID0gMDsKICAgICAgICAlJXsKICAgICAgICAgICAgd3JpdGUgaW5pdDsKCiAgICAgICAgICAgIGFjdGlvbiBhZGQgewogICAgICAgICAgICAgICAgaXBbcG9zXSA9IGlwW3Bvc10gKiAxMCArIChmYyAtICcwJyk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGFjdGlvbiBuZXh0IHsKICAgICAgICAgICAgICAgICsrcG9zOyAgCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGRlY19vY3RldCA9IChkaWdpdCB8CiAgICAgICAgICAgICAgICBbMS05XSAuIGRpZ2l0IHwKICAgICAgICAgICAgICAgICIxIiAuIGRpZ2l0IC4gZGlnaXQgfAogICAgICAgICAgICAgICAgIjIiIC4gKFswLTRdIC4gZGlnaXR8ICI1IiAuIFswLTVdKSApICRhZGQ7CiAgICAgICAgICAgIG1haW4gOj0gZGVjX29jdGV0ICgiLiIgQG5leHQgLiBkZWNfb2N0ZXQpezN9OwogICAgICAgICAgICB3cml0ZSBleGVjOwogICAgICAgIH0lJQogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihBcnJheXMudG9TdHJpbmcoaXApKTsKICAgIH0KfQ==