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

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

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

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

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

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

a.u = c
a.r = e
a.y = h
a.v = b
a.t = g
g.x = n
g.o = e
g.v = b
m.v = e
h.r = m
h.v = m
h.z = m
h.p = e
c.z = n
b.u = c
b.r = h
b.y = e
b.v = a
b.t = g
e.r = m
e.v = m
e.z = m
e.p = h
n.x = g
n.o = e
n.v = b
assert n.x.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: D = None
        self.y: D = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

a.u = c
a.r = e
a.y = h
a.v = b
a.t = g
g.x = n
g.o = e
g.v = b
m.v = e
h.r = m
h.v = m
h.z = m
h.p = e
c.z = n
b.u = c
b.r = h
b.y = e
b.v = a
b.t = g
e.r = m
e.v = m
e.z = m
e.p = h
n.x = g
n.o = e
n.v = b
assert n.x.v.u.txt == "c"