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

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

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

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

h.x = c
e.w = f
e.t = f
i.u = a
i.w = a
i.r = e
c.x = h
f.u = i
f.w = a
f.r = e
l.w = i
l.t = a
a.u = f
a.w = i
a.r = e
b.x = h
d.w = f
d.t = i
assert h.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

h.x = c
e.w = f
e.t = f
i.u = a
i.w = a
i.r = e
c.x = h
f.u = i
f.w = a
f.r = e
l.w = i
l.t = a
a.u = f
a.w = i
a.r = e
b.x = h
d.w = f
d.t = i
assert h.x.x.x.x.txt == "h"