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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: D = None
        self.p: E = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: D = None
        self.p: E = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

j.x = d
j.w = l
j.p = c
j.u = n
m.q = h
m.p = h
m.y = c
m.w = e
m.v = e
l.r = c
l.y = c
l.o = c
l.x = c
l.t = m
c.x = e
c.p = j
i.o = l
i.r = a
h.o = l
h.r = a
a.o = l
a.r = i
n.r = c
n.y = c
n.o = c
n.x = c
n.t = m
e.q = a
e.p = a
e.y = c
e.w = m
e.v = m
d.x = j
d.w = n
d.p = c
d.u = l
assert m.q.o.t.p.r.o.o.x.q.txt == "a"