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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: D = None
        self.o: A = None
        self.w: C = None
        self.s: B = None
        self.t: G = None
        self.q: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: G = None
        self.s: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: D = None
        self.o: A = None
        self.w: C = None
        self.s: B = None
        self.t: G = None
        self.q: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: G = None
        self.s: D = None
        self.z: C = None
        self.txt = txt

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

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