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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: E = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

h.v = j
h.s = j
h.o = j
d.q = c
d.r = j
d.v = k
d.t = h
a.v = d
a.w = c
a.s = h
a.x = j
k.v = c
j.o = h
j.x = l
j.r = l
j.t = k
j.w = d
l.v = m
c.v = d
c.w = m
c.s = h
c.x = j
m.v = d
m.w = a
m.s = h
m.x = j
assert k.v.v.r.o.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: E = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

h.v = j
h.s = j
h.o = j
d.q = c
d.r = j
d.v = k
d.t = h
a.v = d
a.w = c
a.s = h
a.x = j
k.v = c
j.o = h
j.x = l
j.r = l
j.t = k
j.w = d
l.v = m
c.v = d
c.w = m
c.s = h
c.x = j
m.v = d
m.w = a
m.s = h
m.x = j
assert k.v.v.r.o.o.r.txt == "l"