class ShortenUrl:
    """
    Conversion between natural number (IDs) and short strings
    """

    _alphabet = \
    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
    _base = len(_alphabet)

    def encode(self, num):
        string = ""
        while num > 0:
            string = self._alphabet[num % self._base] + string
            num //= self._base

        return string

    def decode(self, string):
        num = 0
        for char in string:
            num = num * self._base + self._alphabet.index(char)
        return num

35d13ba1f23ef21d8f08cb458e307a42ddf8f1bf
class ShortenUrl:
    <mask token>
    <mask token>
    <mask token>

    def encode(self, num):
        string = ''
        while num > 0:
            string = self._alphabet[num % self._base] + string
            num //= self._base
        return string
    <mask token>

class ShortenUrl:
    <mask token>
    <mask token>
    <mask token>

    def encode(self, num):
        string = ''
        while num > 0:
            string = self._alphabet[num % self._base] + string
            num //= self._base
        return string

    def decode(self, string):
        num = 0
        for char in string:
            num = num * self._base + self._alphabet.index(char)
        return num

class ShortenUrl:
    <mask token>
    _alphabet = (
        '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')
    _base = len(_alphabet)

    def encode(self, num):
        string = ''
        while num > 0:
            string = self._alphabet[num % self._base] + string
            num //= self._base
        return string

    def decode(self, string):
        num = 0
        for char in string:
            num = num * self._base + self._alphabet.index(char)
        return num

class ShortenUrl:
    """
    Conversion between natural number (IDs) and short strings
    """
    _alphabet = (
        '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')
    _base = len(_alphabet)

    def encode(self, num):
        string = ''
        while num > 0:
            string = self._alphabet[num % self._base] + string
            num //= self._base
        return string

    def decode(self, string):
        num = 0
        for char in string:
            num = num * self._base + self._alphabet.index(char)
        return num

class ShortenUrl:
    """
    Conversion between natural number (IDs) and short strings
    """

    _alphabet = \
    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
    _base = len(_alphabet)

    def encode(self, num):
        string = ""
        while num > 0:
            string = self._alphabet[num % self._base] + string
            num //= self._base

        return string

    def decode(self, string):
        num = 0
        for char in string:
            num = num * self._base + self._alphabet.index(char)
        return num
