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

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

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

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

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

l.s = e
l.y = n
b.p = n
b.z = a
c.z = n
c.t = n
i.y = a
i.z = h
i.s = h
h.y = a
h.z = i
h.s = i
a.p = c
a.z = b
e.s = l
e.y = c
n.z = c
n.t = c
assert c.t.z.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: C = None
        self.txt = txt

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

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

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

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

l.s = e
l.y = n
b.p = n
b.z = a
c.z = n
c.t = n
i.y = a
i.z = h
i.s = h
h.y = a
h.z = i
h.s = i
a.p = c
a.z = b
e.s = l
e.y = c
n.z = c
n.t = c
assert c.t.z.t.t.txt == "c"