class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: D = None
        self.s: D = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: F = None
        self.t: B = None
        self.x: B = None
        self.txt = txt

b = A("b")
i = B("i")
m = C("m")
k = D("k")
a = E("a")
g = F("g")
d = G("d")
j = H("j")
n = A("n")
h = B("h")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: D = None
        self.s: D = None
        self.q: A = None
        self.r: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: F = None
        self.t: B = None
        self.x: B = None
        self.txt = txt

b = A("b")
i = B("i")
m = C("m")
k = D("k")
a = E("a")
g = F("g")
d = G("d")
j = H("j")
n = A("n")
h = B("h")

b.s = n
b.o = j
b.v = k
i.r = h
i.p = k
m.t = d
k.t = h
k.u = h
a.y = j
a.p = k
a.s = k
a.q = b
a.r = i
g.y = a
g.o = n
d.s = m
j.z = a
j.p = g
j.t = h
j.x = i
n.s = b
n.o = j
n.v = k
h.r = i
h.p = k
assert d.s.t.s.t.txt == "d"