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

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

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

class D:
    def __init__(self, txt: str):
        self.q: 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.r: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.y: C = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

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

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

g.x = j
g.o = f
g.y = m
g.v = k
g.w = k
f.q = k
f.o = k
f.r = j
f.v = j
f.p = g
f.y = b
k.u = b
e.q = f
b.r = f
j.r = g
j.q = e
n.v = f
n.w = g
n.y = k
n.z = j
n.r = b
m.o = k
m.z = f
m.u = n
m.q = g
assert j.q.q.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.y: H = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: 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.r: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: A = None
        self.y: C = None
        self.z: F = None
        self.r: E = None
        self.txt = txt

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

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

g.x = j
g.o = f
g.y = m
g.v = k
g.w = k
f.q = k
f.o = k
f.r = j
f.v = j
f.p = g
f.y = b
k.u = b
e.q = f
b.r = f
j.r = g
j.q = e
n.v = f
n.w = g
n.y = k
n.z = j
n.r = b
m.o = k
m.z = f
m.u = n
m.q = g
assert j.q.q.q.u.txt == "b"