class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: H = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: H = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.x: H = None
        self.p: F = None
        self.w: E = None
        self.o: D = None
        self.y: H = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: F = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.o: H = None
        self.s: H = None
        self.p: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: H = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: A = None
        self.x: H = None
        self.p: F = None
        self.w: E = None
        self.o: D = None
        self.y: H = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: F = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.o: H = None
        self.s: H = None
        self.p: C = None
        self.txt = txt

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

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

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