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

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

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

e = A("e")
h = B("h")
b = C("b")
f = C("f")
a = A("a")
j = C("j")
d = A("d")
n = C("n")
l = B("l")

e.t = l
h.p = f
h.q = a
h.o = l
b.w = n
b.z = h
b.v = h
f.w = j
f.z = l
f.v = l
a.t = h
j.w = f
j.z = h
j.v = h
d.t = h
n.w = f
n.z = h
n.v = h
l.p = b
l.q = d
l.o = h
assert n.v.o.q.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
b = C("b")
f = C("f")
a = A("a")
j = C("j")
d = A("d")
n = C("n")
l = B("l")

e.t = l
h.p = f
h.q = a
h.o = l
b.w = n
b.z = h
b.v = h
f.w = j
f.z = l
f.v = l
a.t = h
j.w = f
j.z = h
j.v = h
d.t = h
n.w = f
n.z = h
n.v = h
l.p = b
l.q = d
l.o = h
assert n.v.o.q.t.o.txt == "l"