class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: H = None
        self.r: G = None
        self.y: G = None
        self.w: H = None
        self.v: G = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: F = None
        self.w: F = None
        self.s: D = None
        self.y: A = None
        self.r: H = 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.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.y: G = None
        self.x: F = None
        self.s: D = None
        self.w: G = None
        self.q: E = None
        self.txt = txt

k = A("k")
i = B("i")
f = C("f")
h = D("h")
e = E("e")
d = F("d")
b = G("b")
g = H("g")

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: H = None
        self.r: G = None
        self.y: G = None
        self.w: H = None
        self.v: G = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: F = None
        self.w: F = None
        self.s: D = None
        self.y: A = None
        self.r: H = 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.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.y: G = None
        self.x: F = None
        self.s: D = None
        self.w: G = None
        self.q: E = None
        self.txt = txt

k = A("k")
i = B("i")
f = C("f")
h = D("h")
e = E("e")
d = F("d")
b = G("b")
g = H("g")

k.x = h
i.y = b
i.w = b
i.t = g
f.s = k
f.q = g
f.w = g
f.p = g
f.r = b
f.y = b
f.v = b
h.w = e
h.v = b
h.q = g
e.o = k
e.y = k
e.z = d
e.w = d
e.s = h
e.r = g
d.o = g
b.s = d
g.z = b
g.y = b
g.w = b
g.v = f
g.x = d
g.s = h
g.q = e
assert b.s.o.q.y.x.v.s.txt == "d"