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

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

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

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

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

n = A("n")
a = B("a")
h = C("h")
g = D("g")
j = E("j")
k = C("k")
m = C("m")
l = E("l")

n.z = a
n.u = l
n.t = k
n.x = j
n.v = g
a.w = h
a.z = m
a.p = n
a.t = n
h.u = n
h.o = k
h.w = m
g.r = j
g.t = a
j.u = k
j.x = g
k.u = n
k.o = h
k.w = m
m.u = n
m.o = h
m.w = k
l.u = m
l.x = g
assert l.u.w.u.x.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.t: C = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
h = C("h")
g = D("g")
j = E("j")
k = C("k")
m = C("m")
l = E("l")

n.z = a
n.u = l
n.t = k
n.x = j
n.v = g
a.w = h
a.z = m
a.p = n
a.t = n
h.u = n
h.o = k
h.w = m
g.r = j
g.t = a
j.u = k
j.x = g
k.u = n
k.o = h
k.w = m
m.u = n
m.o = h
m.w = k
l.u = m
l.x = g
assert l.u.w.u.x.x.t.txt == "a"