#include <iostream>
#include <sstream>
using namespace std;
std::string ver_srting(int a, int b, int c) {
std::ostringstream ss;
ss << a << '.' << b << '.' << c;
return ss.str();
}
int main() {
std::string true_cxx =
#ifdef __clang__
"clang++";
#else
"g++";
#endif
std::string true_cxx_ver =
#ifdef __clang__
ver_srting(__clang_major__, __clang_minor__, __clang_patchlevel__);
#else
ver_srting(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#endif
cout << true_cxx << endl;
cout << true_cxx_ver << endl;
return 0;
}