class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: D = None
        self.txt = txt

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

k = A("k")
a = B("a")
b = C("b")
h = D("h")
c = E("c")
l = A("l")
d = D("d")
m = E("m")
e = A("e")

k.r = a
k.q = d
k.y = d
k.w = b
a.z = c
a.q = c
a.s = h
b.v = m
h.w = c
h.r = d
c.s = b
c.x = b
c.o = k
c.z = d
c.q = a
l.r = a
l.q = d
l.y = d
l.w = b
d.w = m
d.r = h
m.s = b
m.x = b
m.o = k
m.z = d
m.q = a
e.r = a
e.q = h
e.w = b
e.y = d
assert b.v.o.w.v.o.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: D = None
        self.txt = txt

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

k = A("k")
a = B("a")
b = C("b")
h = D("h")
c = E("c")
l = A("l")
d = D("d")
m = E("m")
e = A("e")

k.r = a
k.q = d
k.y = d
k.w = b
a.z = c
a.q = c
a.s = h
b.v = m
h.w = c
h.r = d
c.s = b
c.x = b
c.o = k
c.z = d
c.q = a
l.r = a
l.q = d
l.y = d
l.w = b
d.w = m
d.r = h
m.s = b
m.x = b
m.o = k
m.z = d
m.q = a
e.r = a
e.q = h
e.w = b
e.y = d
assert b.v.o.w.v.o.y.r.txt == "h"