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

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

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

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

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

d = A("d")
a = B("a")
g = C("g")
e = D("e")
f = E("f")
m = C("m")
b = A("b")
h = E("h")
l = B("l")
c = D("c")

d.p = g
d.x = h
a.x = l
a.o = l
a.t = h
a.z = d
a.u = g
g.o = c
g.z = a
e.z = a
e.t = g
e.p = c
e.r = f
e.x = l
f.q = l
f.t = h
m.o = c
m.z = l
b.p = m
b.x = f
h.q = a
h.t = f
l.x = a
l.o = a
l.t = f
l.z = b
l.u = m
c.z = l
c.t = m
c.p = e
c.r = h
c.x = a
assert e.x.o.u.o.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

d = A("d")
a = B("a")
g = C("g")
e = D("e")
f = E("f")
m = C("m")
b = A("b")
h = E("h")
l = B("l")
c = D("c")

d.p = g
d.x = h
a.x = l
a.o = l
a.t = h
a.z = d
a.u = g
g.o = c
g.z = a
e.z = a
e.t = g
e.p = c
e.r = f
e.x = l
f.q = l
f.t = h
m.o = c
m.z = l
b.p = m
b.x = f
h.q = a
h.t = f
l.x = a
l.o = a
l.t = f
l.z = b
l.u = m
c.z = l
c.t = m
c.p = e
c.r = h
c.x = a
assert e.x.o.u.o.z.u.txt == "m"