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

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

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

f = A("f")
d = B("d")
l = C("l")
b = C("b")
j = B("j")
m = B("m")
h = C("h")
i = C("i")
k = A("k")
n = C("n")

f.z = m
f.o = k
d.t = k
l.u = f
l.t = h
b.u = k
b.t = i
j.t = f
m.t = f
h.u = k
h.t = i
i.u = k
i.t = n
k.z = j
k.o = f
n.u = k
n.t = l
assert l.t.u.z.t.z.t.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.txt = txt

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

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

f = A("f")
d = B("d")
l = C("l")
b = C("b")
j = B("j")
m = B("m")
h = C("h")
i = C("i")
k = A("k")
n = C("n")

f.z = m
f.o = k
d.t = k
l.u = f
l.t = h
b.u = k
b.t = i
j.t = f
m.t = f
h.u = k
h.t = i
i.u = k
i.t = n
k.z = j
k.o = f
n.u = k
n.t = l
assert l.t.u.z.t.z.t.z.t.txt == "f"