# Brute-force words generator
# author: Robert Gawron
# modified 23.XII.2006
use strict;

# possible letters in the password
my @alphabet = qw(a b c d e f g h i j k l m n o p r s t u w x y z q);
my $max_word = 3;
my $min_word = 1;

# $_[0] - current lenght of string
# $_[1] - current string
sub add_letter {
  # we don't want to watch too short strings :P
  if($_[0]+1 > $min_word) {
    print "$_[1]\n";
  }
  # create next words
  if($_[0] < $max_word) {
    foreach my $l (@alphabet) {
      add_letter($_[0]+1, $l.$_[1]); 
    }
  }
}

###### script is begining here ######
add_letter(0, "");
######  script is ending here  ######
