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

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

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

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

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

m = A("m")
c = B("c")
f = C("f")
k = D("k")
d = E("d")
h = C("h")
i = A("i")
n = B("n")
j = C("j")
g = E("g")

m.v = c
m.o = g
m.p = i
m.z = n
m.y = j
c.r = h
c.q = k
c.z = k
c.p = i
c.o = i
f.v = m
k.x = m
k.z = g
d.z = k
h.v = m
i.v = c
i.z = c
i.o = g
i.p = m
i.y = f
n.r = j
n.q = k
n.z = k
n.p = i
n.o = i
j.v = i
g.z = k
assert h.v.y.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.p: A = None
        self.z: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

m = A("m")
c = B("c")
f = C("f")
k = D("k")
d = E("d")
h = C("h")
i = A("i")
n = B("n")
j = C("j")
g = E("g")

m.v = c
m.o = g
m.p = i
m.z = n
m.y = j
c.r = h
c.q = k
c.z = k
c.p = i
c.o = i
f.v = m
k.x = m
k.z = g
d.z = k
h.v = m
i.v = c
i.z = c
i.o = g
i.p = m
i.y = f
n.r = j
n.q = k
n.z = k
n.p = i
n.o = i
j.v = i
g.z = k
assert h.v.y.v.p.v.txt == "c"