class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: 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.v: B = None
        self.o: B = None
        self.txt = txt

l = A("l")
i = B("i")
c = C("c")
h = C("h")
g = A("g")
k = C("k")
b = C("b")
n = A("n")
m = A("m")

l.v = i
l.z = i
i.r = b
c.v = i
c.o = i
h.v = i
h.o = i
g.v = i
g.z = i
k.v = i
k.o = i
b.v = i
b.o = i
n.v = i
n.z = i
m.v = i
m.z = i
assert b.v.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: 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.v: B = None
        self.o: B = None
        self.txt = txt

l = A("l")
i = B("i")
c = C("c")
h = C("h")
g = A("g")
k = C("k")
b = C("b")
n = A("n")
m = A("m")

l.v = i
l.z = i
i.r = b
c.v = i
c.o = i
h.v = i
h.o = i
g.v = i
g.z = i
k.v = i
k.o = i
b.v = i
b.o = i
n.v = i
n.z = i
m.v = i
m.z = i
assert b.v.r.o.r.txt == "b"