#include <iostream>
using namespace std;
void main()
{
char a;
int b;
cout << "Input first coordinate (characters from 'a' to 'h'): ";
cin >> a;
cout << "Input second coordinate(numbers from 1 to 8) : ";
cin >> b;
for (int i = 1; i <= 8; ++i)
{
if (i == 1)
{
cout << " ";
for (char j = 'a'; j <= 'h'; ++j)
{
cout << j;
}
}
cout << endl << i;
for (char j = 'a'; j <= 'h'; ++j)
{
for (int z = 1; z < 8; ++z)
{
if ((j == a - z && i == b - z) || (j == a + z && i == b + z) || (j == a - z && i == b + z) || (j == a + z && i == b - z))
{
cout << "*";
}
}
if (j == a && i == b)
{
cout << "B";
}
else
{
cout << " ";
}
}
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnZvaWQgbWFpbigpCnsKCWNoYXIgYTsKCWludCBiOwoJCgljb3V0IDw8ICJJbnB1dCBmaXJzdCBjb29yZGluYXRlIChjaGFyYWN0ZXJzIGZyb20gJ2EnIHRvICdoJyk6ICI7CgljaW4gPj4gYTsKCgljb3V0IDw8ICJJbnB1dCBzZWNvbmQgY29vcmRpbmF0ZShudW1iZXJzIGZyb20gMSB0byA4KSA6ICI7CgljaW4gPj4gYjsKCQoJZm9yIChpbnQgaSA9IDE7IGkgPD0gODsgKytpKQoJCXsKCQkJaWYgKGkgPT0gMSkKCQkJewoJCQkJY291dCA8PCAiICI7CgoJCQkJZm9yIChjaGFyIGogPSAnYSc7IGogPD0gJ2gnOyArK2opCgkJCQl7CgkJCQkJY291dCA8PCBqOwoJCQkJfQoJCQl9CgoJCQljb3V0IDw8IGVuZGwgPDwgaTsKCgkJCWZvciAoY2hhciBqID0gJ2EnOyBqIDw9ICdoJzsgKytqKQoJCQl7CgkJCQlmb3IgKGludCB6ID0gMTsgeiA8IDg7ICsreikKCQkJCXsKCQkJCQlpZiAoKGogPT0gYSAtIHogJiYgaSA9PSBiIC0geikgfHwgKGogPT0gYSArIHogJiYgaSA9PSBiICsgeikgfHwgKGogPT0gYSAtIHogJiYgaSA9PSBiICsgeikgfHwgKGogPT0gYSArIHogJiYgaSA9PSBiIC0geikpCgkJCQkJewoJCQkJCQljb3V0IDw8ICIqIjsKCQkJCQl9CgkJCQl9CgoJCQkJaWYgKGogPT0gYSAmJiBpID09IGIpCgkJCQl7CgkJCQkJY291dCA8PCAiQiI7CgkJCQl9CgkJCQllbHNlCgkJCQl7CgkJCQkJY291dCA8PCAiICI7CgkJCQl9CgkJCX0KCQl9Cn0=