class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.txt = txt

i = A("i")
l = B("l")
k = C("k")
e = D("e")
h = E("h")

i.w = k
l.v = i
l.t = k
k.q = l
k.o = l
k.v = l
e.t = k
e.q = k
e.z = l
h.y = i
h.x = k
assert e.z.t.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.txt = txt

i = A("i")
l = B("l")
k = C("k")
e = D("e")
h = E("h")

i.w = k
l.v = i
l.t = k
k.q = l
k.o = l
k.v = l
e.t = k
e.q = k
e.z = l
h.y = i
h.x = k
assert e.z.t.o.v.txt == "i"