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

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

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

b = A("b")
e = B("e")
f = C("f")
n = C("n")
l = B("l")
h = A("h")
k = B("k")
c = C("c")

b.p = k
b.u = f
b.x = h
e.o = h
e.z = k
f.s = b
f.t = b
n.s = b
n.t = b
l.o = b
l.z = e
h.p = e
h.u = n
h.x = b
k.o = h
k.z = e
c.s = b
c.t = b
assert f.s.u.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

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

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

b = A("b")
e = B("e")
f = C("f")
n = C("n")
l = B("l")
h = A("h")
k = B("k")
c = C("c")

b.p = k
b.u = f
b.x = h
e.o = h
e.z = k
f.s = b
f.t = b
n.s = b
n.t = b
l.o = b
l.z = e
h.p = e
h.u = n
h.x = b
k.o = h
k.z = e
c.s = b
c.t = b
assert f.s.u.t.u.t.txt == "b"