#include <iostream>
#include <string>

using namespace std;

int main(){
    string word;
    int count;
    int start = -1, end = -1;
    bool b;

    cout << "Input word: ";
    getline(cin, word);

    start = word.find_first_of('a');
    end = word.find_last_of('z');

    if (start < 0 || end < 0){
        cout << "Stroke must contain symbols 'a' and 'z'!" << endl;
        return 0;
    }

    b = 0;
    for (int i = start; i < end; i++){
        if (word[i] >= 'a' && word[i] <= 'z'){
            continue;
        }
        else {
            b = 1;
            break;
        }
    }

    cout << "Result: " << b << endl;

    return 0;
}