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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: D = None
        self.s: H = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: F = None
        self.p: D = None
        self.q: B = None
        self.t: B = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.r: C = None
        self.t: D = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: G = None
        self.r: A = None
        self.v: B = None
        self.txt = txt

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

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

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

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

m.q = d
m.z = h
m.y = h
m.o = i
m.v = i
m.r = g
m.p = k
m.t = f
f.y = k
f.z = e
f.s = g
f.x = h
f.p = h
d.z = k
d.s = k
d.p = e
d.q = f
d.t = f
d.y = h
e.u = i
e.q = f
e.r = d
e.p = d
e.t = b
i.p = g
i.u = h
i.r = m
i.v = f
k.t = g
h.x = g
h.t = g
h.v = d
g.s = b
b.u = i
b.q = f
b.r = d
b.p = d
b.t = e
assert g.s.t.q.y.t.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.o: E = None
        self.r: H = None
        self.p: F = None
        self.t: B = None
        self.y: G = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: D = None
        self.s: H = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: F = None
        self.p: D = None
        self.q: B = None
        self.t: B = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: B = None
        self.r: C = None
        self.t: D = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: G = None
        self.r: A = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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