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

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

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

d = A("d")
l = B("l")
m = C("m")
j = B("j")
g = A("g")
h = C("h")
n = B("n")
b = C("b")
k = A("k")

d.o = h
d.z = h
l.o = j
l.w = j
l.x = b
m.t = j
j.o = l
j.w = l
j.x = m
g.o = h
g.z = h
h.t = n
n.o = j
n.x = h
n.w = l
b.t = j
k.o = h
k.z = m
assert m.t.x.t.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.txt = txt

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

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

d = A("d")
l = B("l")
m = C("m")
j = B("j")
g = A("g")
h = C("h")
n = B("n")
b = C("b")
k = A("k")

d.o = h
d.z = h
l.o = j
l.w = j
l.x = b
m.t = j
j.o = l
j.w = l
j.x = m
g.o = h
g.z = h
h.t = n
n.o = j
n.x = h
n.w = l
b.t = j
k.o = h
k.z = m
assert m.t.x.t.x.t.txt == "j"