#include <iostream>                    // Ex30
using namespace std;
struct T {
    void f( int i ) {
        cout << "f(" << i << ")" << endl;
        if ( i > 0 ) g( i - 1 );    // no forward declaration needed
        cout << "f(" << i << ")" << endl;
    }
    void g( int i ) {
        cout << "g(" << i << ")" << endl;
        if ( i > 0 ) f( i - 1 );
        cout << "g(" << i << ")" << endl;
    }
};
int main() {
    T x;
    x.f( 5 );
    cout << endl;
    x.g( 4 );
}
