class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: I = None
        self.z: F = None
        self.o: E = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: E = None
        self.w: C = None
        self.u: A = None
        self.x: E = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: E = None
        self.o: C = None
        self.z: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: D = None
        self.z: C = None
        self.r: I = None
        self.u: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: I = None
        self.r: B = None
        self.o: C = None
        self.x: I = None
        self.p: F = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.txt = txt

a = A("a")
e = B("e")
m = C("m")
f = D("f")
k = E("k")
d = F("d")
g = G("g")
b = H("b")
h = I("h")

a.u = d
a.z = d
a.v = d
a.w = h
a.o = k
a.r = f
e.q = b
e.p = k
e.x = k
e.w = m
e.u = a
e.y = g
m.r = b
m.q = a
f.y = d
f.z = d
f.v = d
f.w = k
f.o = m
k.w = e
k.y = f
k.z = m
k.u = m
k.r = h
d.s = k
d.q = a
d.t = b
g.r = k
g.x = b
g.v = m
g.y = m
b.s = e
b.r = e
b.v = h
b.x = h
b.o = m
b.p = d
b.w = f
h.w = e
h.u = m
assert h.u.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: I = None
        self.z: F = None
        self.o: E = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: E = None
        self.w: C = None
        self.u: A = None
        self.x: E = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: E = None
        self.o: C = None
        self.z: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: D = None
        self.z: C = None
        self.r: I = None
        self.u: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: I = None
        self.r: B = None
        self.o: C = None
        self.x: I = None
        self.p: F = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.txt = txt

a = A("a")
e = B("e")
m = C("m")
f = D("f")
k = E("k")
d = F("d")
g = G("g")
b = H("b")
h = I("h")

a.u = d
a.z = d
a.v = d
a.w = h
a.o = k
a.r = f
e.q = b
e.p = k
e.x = k
e.w = m
e.u = a
e.y = g
m.r = b
m.q = a
f.y = d
f.z = d
f.v = d
f.w = k
f.o = m
k.w = e
k.y = f
k.z = m
k.u = m
k.r = h
d.s = k
d.q = a
d.t = b
g.r = k
g.x = b
g.v = m
g.y = m
b.s = e
b.r = e
b.v = h
b.x = h
b.o = m
b.p = d
b.w = f
h.w = e
h.u = m
assert h.u.q.u.txt == "d"