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

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

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

e = A("e")
i = B("i")
c = C("c")
l = A("l")
b = C("b")
f = A("f")
m = C("m")
h = B("h")

e.p = h
i.r = b
c.u = m
c.t = h
l.p = h
b.u = c
b.t = i
f.p = h
m.u = b
m.t = i
h.r = c
assert b.t.r.u.u.t.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

e = A("e")
i = B("i")
c = C("c")
l = A("l")
b = C("b")
f = A("f")
m = C("m")
h = B("h")

e.p = h
i.r = b
c.u = m
c.t = h
l.p = h
b.u = c
b.t = i
f.p = h
m.u = b
m.t = i
h.r = c
assert b.t.r.u.u.t.r.u.txt == "c"