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

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

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

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

b.z = d
b.u = l
b.r = l
n.u = h
e.u = b
e.x = l
l.z = d
l.u = h
l.r = b
h.z = e
h.u = b
h.r = l
j.u = l
d.u = h
d.x = l
a.u = b
assert l.u.z.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

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

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

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

b.z = d
b.u = l
b.r = l
n.u = h
e.u = b
e.x = l
l.z = d
l.u = h
l.r = b
h.z = e
h.u = b
h.r = l
j.u = l
d.u = h
d.x = l
a.u = b
assert l.u.z.u.r.u.txt == "h"