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

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

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

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

a.x = i
m.y = l
c.o = i
e.o = l
i.y = m
j.x = i
k.o = m
n.x = i
l.y = m
assert j.x.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

a.x = i
m.y = l
c.o = i
e.o = l
i.y = m
j.x = i
k.o = m
n.x = i
l.y = m
assert j.x.y.y.y.y.y.txt == "m"