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

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

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

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

a.t = j
j.y = b
j.o = a
j.q = a
e.z = i
i.z = h
k.y = j
k.o = a
k.q = a
h.z = e
m.y = l
m.o = a
m.q = a
b.y = k
b.o = a
b.q = a
l.y = b
l.o = a
l.q = a
assert b.y.y.o.t.o.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

a.t = j
j.y = b
j.o = a
j.q = a
e.z = i
i.z = h
k.y = j
k.o = a
k.q = a
h.z = e
m.y = l
m.o = a
m.q = a
b.y = k
b.o = a
b.q = a
l.y = b
l.o = a
l.q = a
assert b.y.y.o.t.o.t.y.txt == "b"