was just checking errors with a compiler and missed the idea of that software. but this doesn't work because it makes no sense
if(a[5] == d[5]) means it's true if the 6th element of a and d is the same, you probably want to check the whole word, not just a letter.