class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: G = None
        self.v: H = None
        self.z: G = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

c.s = b
i.t = j
j.p = a
j.u = f
j.z = f
j.v = k
j.s = k
n.y = i
h.t = b
b.v = a
a.o = i
a.u = i
a.p = i
a.q = b
k.s = j
k.y = h
k.z = h
k.t = n
k.w = n
k.o = b
k.x = f
f.o = i
f.u = i
f.p = i
f.q = b
assert j.v.w.y.t.v.x.q.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: G = None
        self.v: H = None
        self.z: G = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

c.s = b
i.t = j
j.p = a
j.u = f
j.z = f
j.v = k
j.s = k
n.y = i
h.t = b
b.v = a
a.o = i
a.u = i
a.p = i
a.q = b
k.s = j
k.y = h
k.z = h
k.t = n
k.w = n
k.o = b
k.x = f
f.o = i
f.u = i
f.p = i
f.q = b
assert j.v.w.y.t.v.x.q.v.q.txt == "b"