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

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

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

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

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

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

m.r = d
m.z = d
m.w = j
m.v = l
j.q = c
l.t = g
l.q = g
l.z = c
h.p = m
h.o = m
h.w = j
d.p = k
d.v = g
d.y = l
c.t = g
c.z = l
c.q = h
a.q = l
k.q = l
g.p = m
g.o = m
g.w = k
i.p = m
i.o = m
i.w = a
assert i.w.q.z.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: B = None
        self.v: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

m.r = d
m.z = d
m.w = j
m.v = l
j.q = c
l.t = g
l.q = g
l.z = c
h.p = m
h.o = m
h.w = j
d.p = k
d.v = g
d.y = l
c.t = g
c.z = l
c.q = h
a.q = l
k.q = l
g.p = m
g.o = m
g.w = k
i.p = m
i.o = m
i.w = a
assert i.w.q.z.t.w.txt == "k"