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

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

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

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

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

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

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

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

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

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

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

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

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