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

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

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

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

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

m = A("m")
g = B("g")
a = C("a")
n = D("n")
k = E("k")
j = B("j")
i = D("i")

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

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

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

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

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

m = A("m")
g = B("g")
a = C("a")
n = D("n")
k = E("k")
j = B("j")
i = D("i")

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