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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.u: G = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.x: A = None
        self.p: D = None
        self.t: E = None
        self.o: B = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: A = None
        self.q: G = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.u: G = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: C = None
        self.x: A = None
        self.p: D = None
        self.t: E = None
        self.o: B = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: A = None
        self.q: G = None
        self.o: B = None
        self.txt = txt

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

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