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

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

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

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

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

m = A("m")
c = B("c")
j = C("j")
k = D("k")
l = E("l")
n = C("n")
g = C("g")
b = E("b")

m.v = j
m.o = k
m.w = k
m.z = b
c.o = k
j.q = c
j.p = m
j.r = k
k.p = c
k.s = m
l.v = g
n.q = c
n.p = m
n.r = k
g.q = c
g.p = m
g.r = k
b.v = j
assert c.o.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

m = A("m")
c = B("c")
j = C("j")
k = D("k")
l = E("l")
n = C("n")
g = C("g")
b = E("b")

m.v = j
m.o = k
m.w = k
m.z = b
c.o = k
j.q = c
j.p = m
j.r = k
k.p = c
k.s = m
l.v = g
n.q = c
n.p = m
n.r = k
g.q = c
g.p = m
g.r = k
b.v = j
assert c.o.p.o.txt == "k"