```
class MinStack(object):
def __init__(self):
"""
initialize your data structure here.
"""
self.l=[]
self.l_sorted=[]
def push(self, x):
"""
:type x: int
:rtype: void
"""
self.l.append(x)
self.l_sorted=sorted(self.l)
def pop(self):
"""
:rtype: void
"""
self.l_sorted.remove(self.l.pop())
def top(self):
"""
:rtype: int
"""
return self.l[-1]
def getMin(self):
"""
:rtype: int
"""
return self.l_sorted[0]
```