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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: A = None
        self.s: F = None
        self.u: C = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.u: A = None
        self.t: F = None
        self.p: C = None
        self.v: C = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: C = None
        self.p: D = None
        self.y: H = None
        self.r: B = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: A = None
        self.s: F = None
        self.u: C = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.u: A = None
        self.t: F = None
        self.p: C = None
        self.v: C = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: C = None
        self.p: D = None
        self.y: H = None
        self.r: B = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

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