#!/usr/bin/perl -w
use Net::CIDR ':all';
use strict;
foreach(<STDIN>) {
    chomp;
    s/\s+//g;
    if ( /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,2}\/\d{1,2})$/ ) {
        print join("\n", Net::CIDR::cidr2range("$1")) . "\n";
    }
    elsif ( /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/ ) {
        print "$1\n";
    }
    else { }
}
