class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.t: E = None
        self.x: G = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: F = None
        self.w: F = None
        self.q: D = None
        self.y: H = None
        self.z: H = None
        self.r: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.v: F = None
        self.q: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.t: A = None
        self.w: A = None
        self.y: B = None
        self.s: A = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: F = None
        self.w: F = None
        self.q: D = None
        self.y: H = None
        self.z: H = None
        self.r: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.v: F = None
        self.q: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.t: A = None
        self.w: A = None
        self.y: B = None
        self.s: A = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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