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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.s: E = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.s: E = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

l.o = a
a.z = b
a.v = l
j.z = l
j.r = c
j.v = c
j.s = m
j.p = f
b.w = k
m.s = l
k.z = l
k.r = c
k.v = c
k.s = m
k.p = b
c.z = l
c.r = k
c.s = m
c.v = j
c.p = f
f.w = c
assert k.z.o.z.txt == "b"