#include <stdio.h> int main() { int a, b, c, d; long n1, n2; while (scanf("%d.%d.%d.%d", &a, &b, &c, &d) == 4) { scanf("%u", &n1); n2 = (a << 24) + (b << 16) + (c << 8) + d; printf("%u\n", n2); a = (n1 >> 24); b = (n1 >> 16) & 255; c = (n1 >> 8) & 255; d = n1 & 255; printf("%d.%d.%d.%d\n", a, b, c, d); } return 0; }