class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: G = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: E = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: B = None
        self.w: A = None
        self.p: A = None
        self.u: H = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: G = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: E = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: B = None
        self.w: A = None
        self.p: A = None
        self.u: H = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

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

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

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