#include <iostream.h>
#include <list>

const int len=40;

//typedef char problem[len];
typedef int problem;

typedef list<problem>::const_iterator probItor;

main()
{
  list<problem> problemList; // list of references
  probItor j;
  
  problem jonty;

  cout << "Input a problem: ";
  cin >> jonty;

  while(cin) {
    problemList.push_front(jonty);
    cout << "Input a problem: ";
    cin >> jonty;
  }

  for (j=problemList.end(); j != problemList.begin() ; ) {
    cout << *(--j) << endl;
  }

}
  

