#include <stdio.h>

char* char_names[] = {
    "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel",
    "bs ", "ht ", "nl ", "vt ", "np ", "cr ", "so ", "si ",
    "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb",
    "can", "em ", "sub", "esc", "fs ", "gs ", "rs ", "us ",
    "sp ", " ! ", " \" ", " # ", " $ ", " % ", " & ", " ' ",
    " ( ", " ) ", " * ", " + ", " , ", " - ", " . ", " / ",
    " 0 ", " 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ",
    " 8 ", " 9 ", " : ", " ; ", " < ", " = ", " > ", " ? ",
    " @ ", " A ", " B ", " C ", " D ", " E ", " F ", " G ",
    " H ", " I ", " J ", " K ", " L ", " M ", " N ", " O ",
    " P ", " Q ", " R ", " S ", " T ", " U ", " V ", " W ",
    " X ", " Y ", " Z ", " [ ", " \\ ", " ] ", " ^ ", " _ ",
    " ` ", " a ", " b ", " c ", " d ", " e ", " f ", " g ",
    " h ", " i ", " j ", " k ", " l ", " m ", " n ", " o ",
    " p ", " q ", " r ", " s ", " t ", " u ", " v ", " w ",
    " x ", " y ", " z ", " { ", " | ", " } ", " ~ ", "del"
    };

void oda(FILE* fp)
{
    int c, n;

    n = 1;
    while((c = getc(fp)) != EOF)
    {
	if(c <= 127)
	    printf("%s ", char_names[c]);
	else
	    printf("%03o ", c);
	if(n % 16 == 0)
	    putchar('\n');
	n++;
    }
    putchar('\n');
}

    

int main(int argc, char** argv)
{
    if(argc == 1)
	oda(stdin);
    else
    {
	int i;
	FILE* fp;

	for(i = 1; i < argc; i++)
	{
	    if((fp = fopen(argv[i], "r")) == NULL)
	    {
		perror(argv[i]);
		continue;
	    }
	    oda(fp);
	    fclose(fp);
	}
    }
    return 0;
}
    
