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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.t: A = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

g = A("g")
j = B("j")
n = C("n")
c = D("c")
h = E("h")
b = C("b")

g.v = h
j.w = g
j.r = g
j.q = g
j.t = c
n.o = b
n.w = h
n.p = c
n.x = j
n.r = g
c.v = b
c.s = j
c.z = h
c.q = h
h.v = g
h.s = g
h.t = g
h.p = n
h.z = c
b.o = n
b.w = h
b.p = c
b.x = j
b.r = g
assert h.z.v.p.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.t: A = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

g = A("g")
j = B("j")
n = C("n")
c = D("c")
h = E("h")
b = C("b")

g.v = h
j.w = g
j.r = g
j.q = g
j.t = c
n.o = b
n.w = h
n.p = c
n.x = j
n.r = g
c.v = b
c.s = j
c.z = h
c.q = h
h.v = g
h.s = g
h.t = g
h.p = n
h.z = c
b.o = n
b.w = h
b.p = c
b.x = j
b.r = g
assert h.z.v.p.v.w.txt == "h"