/**
3. Write a function,
int strcmp(const char* s1, const char* s2),
that compares C-style strings. Let it return a
negative number if s1 is lexicographically before s2,
zero if s1 equals s2, and a positive number if s1
is lexicographically after s2. Do not use any
standard library functions. Do not use subscripting; use the dereference operator * instead.
*/

#include <iostream>
using namespace std;

int strcmp(const char* s1, const char* s2) {
    int i = 0;
    while(*(s1+i) || *(s2+i)) { /// not at the end of either string
        if(*(s1+i) == *(s2+i))
            ++i;
        else if(*(s1+i) < *(s2+i))
        {
            cout << *(s1+i) << " < " << *(s2+i) << endl;
            return -1;
        }
        else return 1;
    }
    return 0;
    /**if(!*(s1+i) && !*(s2+i)) return 0;
    else if(!*(s1+i)) return -1;
    else return 1;**/
}


int main() {
    string s1, s2;
    while(cin >> s1 && cin >> s2) {
        cout << "\nYou entered " << s1 << " and " << s2 << endl;
        if(strcmp(s1.c_str(),s2.c_str())<0)
            cout << s1 << " is before " << s2 << endl;
        else if(strcmp(s1.c_str(),s2.c_str())==0)
            cout << s1 << " is the same as " << s2 << endl;
        else cout << s1 << " is after " << s2 << endl;
    }
}
