#include<cstdlib>
#include<iostream>
using namespace std;
int f1(){
cout << "f1" << endl;
return 0;
}
int f2(){
cout << "f2" << endl;
return 0;
}
int f3(){
cout << "f3" << endl;
return 0;
}
int main(){
_onexit(f1);
_onexit(f2);
_onexit(f3);
cout << "main" << endl;
cin.get();
return 0;
}