#!/usr/bin/perl

@images=<>;
chomp for @images;

print "<html>\n<body>\n";
while (@images) {
	@three = splice @images, 0, 3;
	for (@three) {
		($class, $img) = split m|/|, $_;
		print qq{<img src="file:///e:\\images\\$class\\$img" width="30%">\n};
	}
	print qq{<table width="90%"><tr>};
	while (@three < 3) {push @three, '&nbsp;'}
	for (@three) {
		s|.*/||;
		s/\..*//;
		s/(.*)_(.*)/$2 $1/;
		print qq{<td width="30%" align="center">$_};
	}
	print qq{</table>\n<br>\n};
}
print "</body>\n</html>\n";
