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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: H = None
        self.q: C = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: B = None
        self.o: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: H = None
        self.q: C = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: B = None
        self.o: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

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

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