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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.u: G = None
        self.t: F = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.z: B = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: C = None
        self.v: D = None
        self.u: A = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: D = None
        self.v: B = None
        self.q: F = None
        self.o: G = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

k = A("k")
d = B("d")
c = C("c")
g = D("g")
e = E("e")
a = F("a")
l = G("l")
f = H("f")
m = C("m")

k.r = d
d.u = a
d.w = a
d.p = a
d.s = e
d.v = g
d.z = m
c.z = e
c.v = k
c.p = m
g.z = m
g.r = m
g.u = l
g.q = l
g.t = a
e.x = d
e.z = d
e.u = a
e.q = g
e.o = f
a.o = e
a.p = f
l.q = e
l.p = m
l.v = g
l.u = k
l.w = d
f.s = e
f.r = g
f.v = d
f.q = a
f.x = a
f.t = a
f.o = l
m.z = e
m.v = k
m.p = c
assert f.r.u.p.v.r.z.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.u: G = None
        self.t: F = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.z: B = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: C = None
        self.v: D = None
        self.u: A = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: D = None
        self.v: B = None
        self.q: F = None
        self.o: G = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

k = A("k")
d = B("d")
c = C("c")
g = D("g")
e = E("e")
a = F("a")
l = G("l")
f = H("f")
m = C("m")

k.r = d
d.u = a
d.w = a
d.p = a
d.s = e
d.v = g
d.z = m
c.z = e
c.v = k
c.p = m
g.z = m
g.r = m
g.u = l
g.q = l
g.t = a
e.x = d
e.z = d
e.u = a
e.q = g
e.o = f
a.o = e
a.p = f
l.q = e
l.p = m
l.v = g
l.u = k
l.w = d
f.s = e
f.r = g
f.v = d
f.q = a
f.x = a
f.t = a
f.o = l
m.z = e
m.v = k
m.p = c
assert f.r.u.p.v.r.z.p.z.txt == "e"