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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: C = None
        self.s: G = None
        self.w: H = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: G = None
        self.w: A = None
        self.s: G = None
        self.o: F = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.y: G = None
        self.s: C = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: E = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: C = None
        self.s: G = None
        self.w: H = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: G = None
        self.w: A = None
        self.s: G = None
        self.o: F = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.y: G = None
        self.s: C = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: E = None
        self.y: G = None
        self.txt = txt

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

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