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

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

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

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

b.u = m
b.o = d
l.r = b
l.t = j
m.p = l
m.r = b
a.p = l
a.r = j
h.p = i
h.r = j
j.u = d
j.o = m
n.p = l
n.r = b
d.p = i
d.r = j
i.r = j
i.t = b
assert b.u.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.txt = txt

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

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

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

b.u = m
b.o = d
l.r = b
l.t = j
m.p = l
m.r = b
a.p = l
a.r = j
h.p = i
h.r = j
j.u = d
j.o = m
n.p = l
n.r = b
d.p = i
d.r = j
i.r = j
i.t = b
assert b.u.p.r.txt == "b"