class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: B = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.s: F = None
        self.u: H = None
        self.v: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: E = None
        self.r: D = None
        self.s: H = None
        self.p: G = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.s: F = None
        self.u: H = None
        self.v: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: E = None
        self.r: D = None
        self.s: H = None
        self.p: G = None
        self.u: H = None
        self.txt = txt

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

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

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

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