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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: A = None
        self.t: H = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: B = None
        self.t: D = None
        self.o: C = None
        self.x: G = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: A = None
        self.v: D = None
        self.z: C = None
        self.u: B = None
        self.r: G = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: A = None
        self.t: H = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: B = None
        self.t: D = None
        self.o: C = None
        self.x: G = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: A = None
        self.v: D = None
        self.z: C = None
        self.u: B = None
        self.r: G = None
        self.y: G = None
        self.txt = txt

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

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