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

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

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

d = A("d")
j = B("j")
a = C("a")
b = C("b")
h = A("h")
i = C("i")
m = C("m")
l = B("l")
c = C("c")
f = B("f")

d.t = i
j.v = f
j.z = h
a.o = j
a.s = f
b.o = f
b.s = l
h.t = c
i.o = l
i.s = f
m.o = f
m.s = l
l.v = j
l.z = h
c.o = f
c.s = j
f.v = j
f.z = d
assert f.v.z.t.o.v.v.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

d = A("d")
j = B("j")
a = C("a")
b = C("b")
h = A("h")
i = C("i")
m = C("m")
l = B("l")
c = C("c")
f = B("f")

d.t = i
j.v = f
j.z = h
a.o = j
a.s = f
b.o = f
b.s = l
h.t = c
i.o = l
i.s = f
m.o = f
m.s = l
l.v = j
l.z = h
c.o = f
c.s = j
f.v = j
f.z = d
assert f.v.z.t.o.v.v.v.z.txt == "h"