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

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

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

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

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

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

a.p = c
a.u = c
a.o = c
a.v = h
a.s = k
c.r = a
c.z = m
c.w = k
b.r = c
b.v = k
b.y = a
b.x = n
k.r = c
d.r = n
d.v = n
d.s = k
d.z = c
h.r = b
h.s = k
h.z = c
h.v = n
n.r = c
n.v = k
n.y = a
n.x = b
j.r = b
j.v = b
j.s = k
j.z = c
m.p = c
m.u = c
m.o = c
m.v = j
m.s = k
assert c.r.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.o: B = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

a.p = c
a.u = c
a.o = c
a.v = h
a.s = k
c.r = a
c.z = m
c.w = k
b.r = c
b.v = k
b.y = a
b.x = n
k.r = c
d.r = n
d.v = n
d.s = k
d.z = c
h.r = b
h.s = k
h.z = c
h.v = n
n.r = c
n.v = k
n.y = a
n.x = b
j.r = b
j.v = b
j.s = k
j.z = c
m.p = c
m.u = c
m.o = c
m.v = j
m.s = k
assert c.r.v.v.txt == "n"