#include <iostream>
#include <string.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>
using namespace std;
#define N 5
#define M 5
char alphabet[] = { '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' }...