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

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

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

a = A("a")
h = B("h")
c = C("c")
j = B("j")
i = B("i")
m = A("m")
g = A("g")
f = B("f")
l = C("l")
k = C("k")

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

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

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

a = A("a")
h = B("h")
c = C("c")
j = B("j")
i = B("i")
m = A("m")
g = A("g")
f = B("f")
l = C("l")
k = C("k")

a.o = j
a.t = k
h.v = g
h.p = k
c.w = a
j.v = g
j.p = k
i.v = a
i.p = k
m.o = h
m.t = c
g.o = i
g.t = k
f.v = m
f.p = k
l.w = g
k.w = a
assert l.w.o.v.t.w.o.v.t.w.txt == "a"