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

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

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

f = A("f")
h = B("h")
e = C("e")
l = B("l")
d = B("d")
a = B("a")
m = C("m")
n = A("n")

f.x = d
f.o = n
f.t = m
h.q = e
h.z = e
h.p = f
e.u = n
e.y = l
e.r = f
l.q = e
l.z = e
l.p = n
d.q = e
d.z = e
d.p = f
a.q = m
a.z = m
a.p = f
m.u = f
m.r = f
m.y = d
n.x = l
n.o = f
n.t = e
assert e.u.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: A = None
        self.t: C = None
        self.txt = txt

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

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

f = A("f")
h = B("h")
e = C("e")
l = B("l")
d = B("d")
a = B("a")
m = C("m")
n = A("n")

f.x = d
f.o = n
f.t = m
h.q = e
h.z = e
h.p = f
e.u = n
e.y = l
e.r = f
l.q = e
l.z = e
l.p = n
d.q = e
d.z = e
d.p = f
a.q = m
a.z = m
a.p = f
m.u = f
m.r = f
m.y = d
n.x = l
n.o = f
n.t = e
assert e.u.x.z.txt == "e"