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

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

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

l = A("l")
e = B("e")
m = C("m")
k = B("k")
a = A("a")
j = B("j")
i = B("i")
b = C("b")
g = C("g")
c = B("c")

l.y = b
l.x = g
l.w = c
e.v = b
m.z = b
m.v = b
k.v = b
a.y = m
a.x = g
a.w = c
j.v = m
i.v = m
b.z = m
b.v = m
g.z = b
g.v = m
c.v = b
assert g.v.v.z.v.v.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.w: B = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
m = C("m")
k = B("k")
a = A("a")
j = B("j")
i = B("i")
b = C("b")
g = C("g")
c = B("c")

l.y = b
l.x = g
l.w = c
e.v = b
m.z = b
m.v = b
k.v = b
a.y = m
a.x = g
a.w = c
j.v = m
i.v = m
b.z = m
b.v = m
g.z = b
g.v = m
c.v = b
assert g.v.v.z.v.v.z.z.txt == "m"