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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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