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

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

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

d = A("d")
n = B("n")
e = C("e")
a = B("a")
h = B("h")
b = C("b")
m = A("m")
k = A("k")

d.s = m
d.z = n
d.u = b
n.r = a
n.t = a
n.y = k
e.v = h
e.t = b
a.r = h
a.t = h
a.y = k
h.r = n
h.t = a
h.y = d
b.v = a
b.t = e
m.s = d
m.z = h
m.u = b
k.s = m
k.z = a
k.u = e
assert n.r.y.z.y.s.s.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
e = C("e")
a = B("a")
h = B("h")
b = C("b")
m = A("m")
k = A("k")

d.s = m
d.z = n
d.u = b
n.r = a
n.t = a
n.y = k
e.v = h
e.t = b
a.r = h
a.t = h
a.y = k
h.r = n
h.t = a
h.y = d
b.v = a
b.t = e
m.s = d
m.z = h
m.u = b
k.s = m
k.z = a
k.u = e
assert n.r.y.z.y.s.s.u.v.txt == "a"