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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

a.x = l
n.u = h
n.r = h
n.z = l
n.w = i
n.p = a
l.s = j
l.t = h
j.o = i
j.u = h
j.s = l
j.t = d
i.x = d
d.x = l
h.u = n
h.r = n
h.z = l
h.w = i
h.p = a
assert d.x.t.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

a.x = l
n.u = h
n.r = h
n.z = l
n.w = i
n.p = a
l.s = j
l.t = h
j.o = i
j.u = h
j.s = l
j.t = d
i.x = d
d.x = l
h.u = n
h.r = n
h.z = l
h.w = i
h.p = a
assert d.x.t.u.z.txt == "l"