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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.y: D = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.y: D = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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