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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.x: A = None
        self.q: C = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.x: A = None
        self.q: C = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

i.w = n
i.x = l
i.r = h
i.y = e
i.u = e
a.p = n
a.y = h
h.u = n
l.y = a
l.o = n
l.x = i
l.q = h
l.z = e
e.r = a
n.p = a
n.y = h
assert l.q.u.y.u.p.txt == "a"