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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: E = None
        self.w: C = None
        self.x: A = None
        self.t: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: H = None
        self.t: A = None
        self.z: C = None
        self.w: C = None
        self.o: E = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.v: A = None
        self.o: B = None
        self.r: C = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: E = None
        self.w: C = None
        self.x: A = None
        self.t: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: H = None
        self.t: A = None
        self.z: C = None
        self.w: C = None
        self.o: E = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.v: A = None
        self.o: B = None
        self.r: C = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

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

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