시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 453 68 63 20.192%

문제

IPv6은 길이가 128비트인 차세대 인터넷 프로토콜이다.

IPv6의 주소는 32자리의 16진수를 4자리씩 끊어 나타낸다. 이 때, 각 그룹은 콜론 (:)으로 구분해서 나타낸다.

예를 들면, 다음과 같다.

2001:0db8:85a3:0000:0000:8a2e:0370:7334

32자리의 16진수는 사람이 읽고 쓰기에 불편하고, 대부분의 자리가 0이기 때문에 아래와 같이 축약할 수 있다.

1. 각 그룹의 앞자리의 0의 전체 또는 일부를 생략 할 수 있다. 위의 IPv6을 축약하면, 다음과 같다

2001:db8:85a3:0:00:8a2e:370:7334

2. 만약 0으로만 이루어져 있는 그룹이 연속될 경우 콜론 2개(::)로 바꿀 수 있다.

2001:db8:85a3::8a2e:370:7334

2번째 규칙은 모호함을 방지하기 위해서 오직 한 번만 사용할 수 있다.

올바른 축약형 IPv6주소가 주어졌을 때, 이를 원래 IPv6 (32자리의 16진수)로 복원하는 프로그램을 작성하시오.

입력

첫째 줄에 올바른 IPv6 주소가 주어진다. 이 주소는 최대 39글자이다. 또한, 주소는 숫자 0-9, 알파벳 소문자 a-f, 콜론 :으로만 이루어져 있다.

출력

첫째 줄에, 입력으로 주어진 IPv6의 축약되지 않은 형태를 출력한다.

예제 입력 1

25:09:1985:aa:091:4846:374:bb

예제 출력 1

0025:0009:1985:00aa:0091:4846:0374:00bb
W3sicHJvYmxlbV9pZCI6IjMxMDciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJJUHY2IiwiZGVzY3JpcHRpb24iOiI8cD5JUHY2XHVjNzQwIFx1YWUzOFx1Yzc3NFx1YWMwMCAxMjhcdWJlNDRcdWQyYjhcdWM3NzggXHVjYzI4XHVjMTM4XHViMzAwIFx1Yzc3OFx1ZDEzMFx1YjEzNyBcdWQ1MDRcdWI4NWNcdWQxYTBcdWNmNWNcdWM3NzRcdWIyZTQuPFwvcD5cclxuXHJcbjxwPklQdjZ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