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

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

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

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

i.y = a
i.v = a
i.o = m
g.w = h
g.t = l
b.r = l
h.w = l
h.t = g
j.y = b
j.v = a
j.o = l
a.r = m
l.w = m
l.t = g
m.w = l
m.t = l
assert b.r.t.w.t.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.o: B = None
        self.txt = txt

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

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

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

i.y = a
i.v = a
i.o = m
g.w = h
g.t = l
b.r = l
h.w = l
h.t = g
j.y = b
j.v = a
j.o = l
a.r = m
l.w = m
l.t = g
m.w = l
m.t = l
assert b.r.t.w.t.w.w.txt == "l"