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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

l.z = h
l.s = i
l.u = c
b.o = e
e.y = i
i.t = b
n.t = h
c.z = b
c.s = i
c.u = f
f.z = b
f.s = i
f.u = l
h.o = e
assert h.o.y.t.o.y.txt == "i"