#include <bits/stdc++.h>
using namespace std;

class b; 

class a {
private:
    int num1 = 10, num2 = 20;
    
public:
    friend class b; 
    void print(b &obj); 
};

class b {
private:
    int c = 9;

public:
    friend class a;
    void print(a &obj) {
        cout << obj.num1 << " " << obj.num2 << endl;
    }
};


void a::print(b &obj) {
    cout << obj.c << endl;
}

int main() {
    a obj1;
    b obj2;
    obj1.print(obj2); 
    obj2.print(obj1); 
    return 0;
}
