class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: H = None
        self.q: A = None
        self.o: C = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.t: F = None
        self.q: A = None
        self.u: F = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.x: D = None
        self.p: G = None
        self.q: B = None
        self.v: A = None
        self.txt = txt

d = A("d")
b = B("b")
l = C("l")
h = D("h")
k = E("k")
j = F("j")
i = G("i")
f = H("f")

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: H = None
        self.q: A = None
        self.o: C = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.t: F = None
        self.q: A = None
        self.u: F = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.x: D = None
        self.p: G = None
        self.q: B = None
        self.v: A = None
        self.txt = txt

d = A("d")
b = B("b")
l = C("l")
h = D("h")
k = E("k")
j = F("j")
i = G("i")
f = H("f")

d.r = f
b.z = k
l.u = h
h.s = i
h.x = f
h.q = d
h.o = l
h.p = b
k.r = b
j.x = d
j.o = l
i.r = j
i.t = j
i.u = j
i.w = b
i.q = d
i.z = d
f.y = b
f.q = b
f.o = k
f.x = h
f.p = i
f.v = d
assert j.o.u.s.w.z.r.z.txt == "k"