#include <iostream>
#include <string>

// complex.h
namespace CN {
class complex {
public:
    complex(int num);
    friend std::string to_string(const complex &c);
    friend std::ostream& operator<<(std::ostream& out, const complex& o);
    friend std::istream& operator>>(std::istream& in, complex& o);
    
private:
    int i;
};
}

// complex.cpp
// #include "complex.h"

namespace CN {
complex::complex(int num) {
    i = num;
}

std::string to_string(const complex &mc)
{
    return std::to_string(mc.i);
}

std::ostream& operator<<(std::ostream &out, const CN::complex &mc)
{
    out << "CN::complex(" << to_string(mc) << ")";
    return out;
}

std::istream& operator>>(std::istream &in, CN::complex &mc)
{
    in >> mc.i;
    return in;
}
}

//
int main() {
    CN::complex complex(111);
    std::cin >> complex;
    std::cout << complex << std::endl;
    std::cout << to_string(complex) << std::endl;
}