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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: G = None
        self.w: B = None
        self.x: F = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: G = None
        self.w: B = None
        self.x: F = None
        self.z: A = None
        self.txt = txt

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

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