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

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

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

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

g.z = j
g.w = m
g.o = m
j.y = g
k.o = j
h.o = d
b.o = d
m.z = l
m.w = a
m.o = a
a.z = d
a.w = m
a.o = g
f.o = j
l.y = a
d.y = a
assert j.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: A = None
        self.o: A = None
        self.txt = txt

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

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

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

g.z = j
g.w = m
g.o = m
j.y = g
k.o = j
h.o = d
b.o = d
m.z = l
m.w = a
m.o = a
a.z = d
a.w = m
a.o = g
f.o = j
l.y = a
d.y = a
assert j.y.z.y.txt == "g"