Python linked list
\nclass Node:\n    \n    def __init__(self, val, prev=None, next=None):\n        self.val = val\n        self.next = next\n        self.prev = prev\n        \nc
```\nclass Node:\n    \n    def __init__(self, val, prev=None, next=None):\n        self.val = val\n        self.next = next\n        self.prev = prev\n        \nclass BrowserHistory(object):\n\n    def __init__(self, homepage):\n        """\n        :type homepage: str\n        """\n        self.head = Node(val=homepage)\n\n    def visit(self, url):\n        """\n        :type url: str\n        :rtype: None\n        """\n        self.head.next = Node(val=url, prev=self.head)\n        self.head = self.head.next\n\n    def back(self, steps):\n        """\n        :type steps: int\n        :rtype: str\n        """\n        while steps and self.head.prev:\n            self.head = self.head.prev\n            steps -= 1\n        return self.head.val\n        \n\n    def forward(self, steps):\n        """\n        :type steps: int\n        :rtype: str\n        """\n        while steps and self.head.next:\n            self.head = self.head.next\n            steps -= 1\n        return self.head.val\n```
['Python3']