#!/usr/bin/perl -w use strict; for my $h (1 .. 2) { for my $l (1 .. 2) { printf "L%dH%dL%dH%d\n", $l, $h, 3-$l, 3-$h; } }