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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.r: E = None
        self.txt = txt

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

a = A("a")
c = B("c")
j = C("j")
l = D("l")
n = E("n")
k = F("k")
m = G("m")
b = H("b")

a.y = b
a.q = k
a.u = k
a.w = l
c.x = a
j.y = k
j.q = k
j.u = k
j.z = b
j.p = c
j.v = n
j.w = n
l.r = b
n.q = m
n.o = b
n.z = l
k.s = m
m.s = j
m.q = b
m.r = n
b.w = n
b.z = n
b.q = j
b.y = j
b.s = a
b.v = k
b.r = l
b.o = c
assert j.y.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: F = None
        self.w: D = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.r: E = None
        self.txt = txt

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

a = A("a")
c = B("c")
j = C("j")
l = D("l")
n = E("n")
k = F("k")
m = G("m")
b = H("b")

a.y = b
a.q = k
a.u = k
a.w = l
c.x = a
j.y = k
j.q = k
j.u = k
j.z = b
j.p = c
j.v = n
j.w = n
l.r = b
n.q = m
n.o = b
n.z = l
k.s = m
m.s = j
m.q = b
m.r = n
b.w = n
b.z = n
b.q = j
b.y = j
b.s = a
b.v = k
b.r = l
b.o = c
assert j.y.s.r.txt == "n"