Under construction

Still being built. Things may change

Hexadecimal Chaos

Time limit1sMemory limit1024 MB

Summary
Given a shortened IPv6 address, expand it to the full notation of 8 groups of 4 hexadecimal digits separated by colons.
Level

Easy2 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

The next generation internet protocol IPv6 defines a 128128-bit IP address. The full notation of an IPv6 address consists of 88 groups of 44 hexadecimal digits, with the groups separated by colons (':'). For example:

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

Several simplifications of the full notation are allowed to shorten IPv6 addresses.

  • All or some of the leading zeros within a group can be omitted, so the address above can be shortened as:

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

  • In addition, one or more consecutive groups of zeros can be replaced with a double colon ("::"). The address above then becomes:

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

    This simplification can be applied only once, so that the shortened form determines the address uniquely.

Input

The first line contains a string of at most 3939 characters, which is a correctly written IPv6 address. The string consists only of the digits '0' to '9', the lowercase letters 'a' to 'f', and colons (':').

Output

Print the full notation of the given IPv6 address on a single line.

Examples2

  1. Example 1

    Input
    25:09:1985:aa:091:4846:374:bb
    
    Expected output
    0025:0009:1985:00aa:0091:4846:0374:00bb
    
  2. Example 2

    Input
    ::1
    
    Expected output
    0000:0000:0000:0000:0000:0000:0000:0001