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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: D = None
        self.z: C = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.v: B = None
        self.t: B = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.y: C = None
        self.r: A = None
        self.txt = txt

b = A("b")
i = B("i")
a = C("a")
j = D("j")
h = E("h")
e = E("e")
n = C("n")
m = A("m")
g = C("g")
l = A("l")

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: D = None
        self.z: C = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.v: B = None
        self.t: B = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.y: C = None
        self.r: A = None
        self.txt = txt

b = A("b")
i = B("i")
a = C("a")
j = D("j")
h = E("h")
e = E("e")
n = C("n")
m = A("m")
g = C("g")
l = A("l")

b.x = a
b.s = n
b.p = n
i.r = n
i.q = j
i.v = j
i.z = a
i.u = b
a.w = j
a.x = b
a.v = i
a.t = i
a.q = m
j.z = e
j.r = g
j.q = b
j.x = h
h.o = i
h.s = e
h.y = g
h.r = m
e.o = i
e.s = h
e.y = a
e.r = l
n.w = j
n.x = m
n.v = i
n.t = i
n.q = b
m.x = g
m.s = g
m.p = n
g.w = j
g.x = b
g.v = i
g.t = i
g.q = l
l.x = g
l.s = g
l.p = a
assert l.s.x.x.w.z.y.x.p.txt == "n"