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

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

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

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

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

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

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

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

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

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

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

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

h.w = g
h.p = g
h.v = e
h.u = n
c.z = b
e.p = c
e.t = g
b.v = h
g.z = b
g.x = b
g.r = e
g.v = n
n.w = g
n.p = g
n.v = e
n.u = h
assert c.z.v.u.u.txt == "h"