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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.y: B = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

d = A("d")
m = B("m")
a = C("a")
b = D("b")
g = E("g")
i = B("i")
k = C("k")
f = B("f")

d.z = g
d.r = k
d.t = a
d.w = f
m.v = g
a.y = m
a.o = k
a.x = d
a.u = d
b.w = g
b.z = g
b.u = a
b.y = m
b.o = d
g.w = b
g.s = f
i.v = g
k.y = f
k.o = a
k.x = d
k.u = d
f.v = g
assert f.v.s.v.s.v.s.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.t: C = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.y: B = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

d = A("d")
m = B("m")
a = C("a")
b = D("b")
g = E("g")
i = B("i")
k = C("k")
f = B("f")

d.z = g
d.r = k
d.t = a
d.w = f
m.v = g
a.y = m
a.o = k
a.x = d
a.u = d
b.w = g
b.z = g
b.u = a
b.y = m
b.o = d
g.w = b
g.s = f
i.v = g
k.y = f
k.o = a
k.x = d
k.u = d
f.v = g
assert f.v.s.v.s.v.s.v.w.txt == "b"