class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: D = None
        self.r: E = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

f = A("f")
e = B("e")
b = C("b")
c = D("c")
a = E("a")
i = E("i")

f.t = e
f.p = c
f.w = c
f.x = c
f.r = i
e.v = c
b.o = e
c.z = b
a.v = i
a.q = i
a.o = b
a.z = b
a.w = b
i.v = a
i.q = a
i.o = b
i.z = b
i.w = b
assert b.o.v.z.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: D = None
        self.r: E = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

f = A("f")
e = B("e")
b = C("b")
c = D("c")
a = E("a")
i = E("i")

f.t = e
f.p = c
f.w = c
f.x = c
f.r = i
e.v = c
b.o = e
c.z = b
a.v = i
a.q = i
a.o = b
a.z = b
a.w = b
i.v = a
i.q = a
i.o = b
i.z = b
i.w = b
assert b.o.v.z.o.v.txt == "c"