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

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

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

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

e = A("e")
l = B("l")
a = C("a")
i = D("i")
k = A("k")

e.t = a
l.p = k
l.w = k
l.o = i
a.p = k
a.r = i
a.t = i
i.t = l
i.p = a
i.u = a
i.z = k
k.t = a
assert a.t.t.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

e = A("e")
l = B("l")
a = C("a")
i = D("i")
k = A("k")

e.t = a
l.p = k
l.w = k
l.o = i
a.p = k
a.r = i
a.t = i
i.t = l
i.p = a
i.u = a
i.z = k
k.t = a
assert a.t.t.p.t.txt == "a"