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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

h.w = f
h.z = f
h.r = g
f.r = k
f.y = b
f.o = c
g.x = f
g.y = c
g.z = n
g.p = b
g.v = k
c.v = f
c.q = b
d.w = n
d.z = g
d.s = h
k.w = e
k.z = g
k.s = n
e.w = f
e.z = f
e.r = g
b.x = f
b.y = c
b.z = e
b.p = g
b.v = k
n.w = f
n.z = f
n.r = g
assert e.r.v.w.r.p.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

h.w = f
h.z = f
h.r = g
f.r = k
f.y = b
f.o = c
g.x = f
g.y = c
g.z = n
g.p = b
g.v = k
c.v = f
c.q = b
d.w = n
d.z = g
d.s = h
k.w = e
k.z = g
k.s = n
e.w = f
e.z = f
e.r = g
b.x = f
b.y = c
b.z = e
b.p = g
b.v = k
n.w = f
n.z = f
n.r = g
assert e.r.v.w.r.p.z.z.txt == "f"