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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: H = None
        self.y: H = None
        self.w: E = None
        self.u: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.p: H = None
        self.s: B = None
        self.r: B = None
        self.v: A = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: D = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: H = None
        self.y: H = None
        self.w: E = None
        self.u: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.p: H = None
        self.s: B = None
        self.r: B = None
        self.v: A = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: D = None
        self.x: F = None
        self.txt = txt

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

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