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

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

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

h = A("h")
g = B("g")
j = C("j")
i = C("i")
d = B("d")
a = B("a")
f = C("f")
e = A("e")
k = C("k")
c = B("c")

h.s = e
h.t = d
h.p = i
g.y = e
j.z = h
j.o = h
j.u = i
i.z = e
i.o = h
i.u = k
d.y = e
a.y = e
f.z = h
f.o = h
f.u = j
e.s = h
e.t = g
e.p = f
k.z = e
k.o = e
k.u = j
c.y = e
assert d.y.p.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.p: C = None
        self.txt = txt

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

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

h = A("h")
g = B("g")
j = C("j")
i = C("i")
d = B("d")
a = B("a")
f = C("f")
e = A("e")
k = C("k")
c = B("c")

h.s = e
h.t = d
h.p = i
g.y = e
j.z = h
j.o = h
j.u = i
i.z = e
i.o = h
i.u = k
d.y = e
a.y = e
f.z = h
f.o = h
f.u = j
e.s = h
e.t = g
e.p = f
k.z = e
k.o = e
k.u = j
c.y = e
assert d.y.p.u.o.txt == "h"