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

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

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

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

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

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

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

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

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

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

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

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

i.o = l
i.t = l
i.w = l
i.x = m
a.z = d
a.t = d
a.o = h
a.s = i
a.u = l
d.o = h
d.y = a
d.t = e
e.s = l
e.u = l
l.p = m
m.o = l
m.t = l
m.w = l
m.x = i
h.s = l
h.u = l
assert a.u.p.x.o.p.x.txt == "i"