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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.p: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

a.u = e
a.t = l
h.y = l
h.x = e
h.p = e
h.t = e
l.p = a
l.q = i
n.o = k
n.y = i
e.w = k
e.p = k
e.s = h
e.u = a
k.o = n
k.y = l
i.p = a
i.q = l
assert l.p.t.p.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.p: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

a.u = e
a.t = l
h.y = l
h.x = e
h.p = e
h.t = e
l.p = a
l.q = i
n.o = k
n.y = i
e.w = k
e.p = k
e.s = h
e.u = a
k.o = n
k.y = l
i.p = a
i.q = l
assert l.p.t.p.t.p.txt == "a"