class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.u: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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