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

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

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

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

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

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

n.v = c
j.p = d
d.z = c
d.t = j
d.v = j
d.o = n
d.y = n
c.y = j
c.u = n
h.y = g
h.o = c
h.w = n
g.y = h
g.o = c
g.w = n
b.z = c
b.t = j
b.v = j
b.o = n
b.y = n
assert g.o.y.p.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

n.v = c
j.p = d
d.z = c
d.t = j
d.v = j
d.o = n
d.y = n
c.y = j
c.u = n
h.y = g
h.o = c
h.w = n
g.y = h
g.o = c
g.w = n
b.z = c
b.t = j
b.v = j
b.o = n
b.y = n
assert g.o.y.p.z.u.txt == "n"