class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.z: D = None
        self.t: E = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.o: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.r: E = None
        self.w: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.o: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.r: E = None
        self.w: E = None
        self.u: C = None
        self.txt = txt

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

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

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