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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.q: A = None
        self.w: A = None
        self.o: D = None
        self.txt = txt

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

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

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

l.o = i
l.u = i
i.r = j
f.s = i
f.v = b
f.q = l
f.w = l
f.o = c
c.q = b
c.z = f
b.w = i
b.x = f
b.t = j
a.q = b
a.z = f
j.s = i
j.v = b
j.q = l
j.w = l
j.o = m
m.q = b
m.z = j
assert m.z.o.z.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.q: A = None
        self.w: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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