#include <iostream>
#include <string>

using namespace std;

int main () {

    string a, b;
    cin >> a;
    cin >> b;

    if(a<b)
        cout << "first is before last" << endl;
    else
        cout << "Second is before first" << endl;
}
