#include <iostream>
using namespace std;
int main()
{
int n, v[100], k, i, p=1, inv, x, y, numere=0, pare;
cout<<"n="; cin>>n;
for(i=1;i<=n;i++){
cout<<"v["<<i<<"]="; cin>>v[i];
}
cout<<"k="; cin>>k;
for(i=1;i<=n;i++){
x=v[i]; pare=0;
while(x){
if(x%2==0)
pare++;
x=x/10;
}
if(pare==k) numere++;
}
cout<<endl;
cout<<"a)"<<numere;
cout<<endl;
x=v[1]; y=v[n];
while(x!=y)
if(x>y) x=x-y;
else y=y-x;
cout<<"b)"<<x;
cout<<endl;
for(i=1;i<=n;i++){
inv=0; x=v[i];
while(x){
inv=inv*10+x%10;
x=x/10;
}
if(inv==v[i])
p=p*v[i];
}
cout<<"c)"<<p;
return 0;
}