The program below is handling a stack container. What is the output of running the program?
#include <iostream>
#include <stack>
int main()
{
std::stack<int> stack;
stack.push(1);
stack.push(2);
stack.push(3);
stack.pop();
stack.push(4);
stack.top();
stack.pop();
std::cout << stack.top();
}