#include <iostream.h>

char msg[10] = "too big";

int fact(int n) {
  if (n < 0) throw (n);
  else if (n>10) throw (msg);
  else if (n==0) return 1;
  else return n*fact(n-1);
}

main() {

  try {
    cout << fact(3) << endl;
    cout << fact(11) << endl;
    cout << fact(4) << endl;
    cout << fact(-3) << endl;
    cout << fact(5) << endl;
  }
  catch(int n) {
    cout << "neg" << endl;
  }
  catch (char *m) {
    cout << m << endl;
  }
  cout << "hi" << endl;
}
