class Solution {
public:
    stack<int>a;

    void push(int value) {
        a.push(value);
    }
    void pop() {
       a.pop(); 
    }
    int top() {
        return a.top();
    }
    int min() {
        vector<int>b;
        stack<int>c;
        c=a;
        while(!c.empty())
        {
            b.push_back(c.top());
            c.pop();
        }
        sort(b.begin(),b.end());
        return b[0];
    }
};