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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.p: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

m.v = i
m.r = h
m.o = d
m.z = k
m.u = e
e.u = m
e.y = g
e.p = f
e.o = f
a.o = h
a.r = e
a.w = l
a.u = l
a.x = i
d.z = e
d.p = l
d.v = l
d.w = a
g.o = l
g.x = f
g.z = a
k.v = m
k.z = m
k.r = a
k.o = l
k.u = e
h.o = a
h.r = e
h.w = d
h.u = d
h.x = k
l.z = e
l.p = d
l.v = d
l.w = h
i.v = m
i.r = a
i.o = d
i.z = k
i.u = e
f.o = l
f.x = g
f.z = h
assert f.o.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.o: D = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.p: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

m.v = i
m.r = h
m.o = d
m.z = k
m.u = e
e.u = m
e.y = g
e.p = f
e.o = f
a.o = h
a.r = e
a.w = l
a.u = l
a.x = i
d.z = e
d.p = l
d.v = l
d.w = a
g.o = l
g.x = f
g.z = a
k.v = m
k.z = m
k.r = a
k.o = l
k.u = e
h.o = a
h.r = e
h.w = d
h.u = d
h.x = k
l.z = e
l.p = d
l.v = d
l.w = h
i.v = m
i.r = a
i.o = d
i.z = k
i.u = e
f.o = l
f.x = g
f.z = h
assert f.o.v.w.txt == "a"