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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: C = None
        self.z: C = None
        self.p: A = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

k = A("k")
e = B("e")
n = C("n")
i = D("i")
m = E("m")
l = F("l")
j = G("j")
f = H("f")

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: C = None
        self.z: C = None
        self.p: A = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

k = A("k")
e = B("e")
n = C("n")
i = D("i")
m = E("m")
l = F("l")
j = G("j")
f = H("f")

k.v = f
e.o = l
e.q = n
e.z = n
e.p = k
e.t = k
e.u = k
n.y = l
n.w = l
i.r = l
m.z = l
m.q = i
m.v = k
m.s = n
m.y = n
m.p = e
l.s = e
j.y = n
f.v = l
f.o = j
assert m.q.r.s.txt == "e"