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

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

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

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

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

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

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

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

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

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

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

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

a.x = l
a.p = h
l.q = h
l.p = h
h.y = j
h.w = l
h.u = e
h.s = a
h.z = k
k.p = l
e.w = h
j.p = l
i.y = j
i.z = j
i.w = l
i.u = e
i.s = a
assert l.p.u.w.s.x.p.s.txt == "a"