import sys
from socket import inet_aton, inet_ntoa
from struct import pack, unpack

args = sys.argv[1:]
if len(args) == 0:
    args = sys.stdin.readlines()

for cidr in args:
   
   dotted, size_str = cidr.split('/')
   size = int(size_str)

   numeric = unpack('!I', inet_aton(dotted))[0]  
   binary = f'{numeric:
   prefix = binary[:size + 2]                    
                                                 
                                                 

   canon_binary = prefix + '0' * (32 - size)     
   canon_numeric = int(canon_binary, 2)          
   canon_dotted = inet_ntoa(pack('!I',
                            (canon_numeric)))    
   print(f'{canon_dotted}/{size}')