class reverse_iter:
    def __init__(self, iterable):
        self.iterable = iterable
        self.start = len(self.iterable) - 1
        self.end = 0

    def __iter__(self):
        return self

    def __next__(self):
        if self.start < self.end:
            raise StopIteration

        current_index = self.start
        self.start -= 1
        return self.iterable[current_index]


reversed_list = reverse_iter([1, 2, 3, 4])
for item in reversed_list:
    print(item)

class reverse_iter:
    def __init__(self, iterable):
        self.iterable = iterable
        self.start = len(self.iterable) - 1
        self.end = 0

    def __iter__(self):
        return self

    def __next__(self):
        if self.start < self.end:
            raise StopIteration

        current_index = self.start
        self.start -= 1
        return self.iterable[current_index]


reversed_list = reverse_iter([1, 2, 3, 4])
for item in reversed_list:
    print(item)
