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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: F = None
        self.q: G = None
        self.t: G = None
        self.y: D = None
        self.s: G = None
        self.o: H = None
        self.w: G = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: H = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: E = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: B = None
        self.s: I = None
        self.v: F = None
        self.txt = txt

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

f = A("f")
j = B("j")
n = C("n")
a = D("a")
c = E("c")
m = F("m")
g = G("g")
b = H("b")
e = I("e")
l = G("l")

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: F = None
        self.q: G = None
        self.t: G = None
        self.y: D = None
        self.s: G = None
        self.o: H = None
        self.w: G = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: H = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: E = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: B = None
        self.s: I = None
        self.v: F = None
        self.txt = txt

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

f = A("f")
j = B("j")
n = C("n")
a = D("a")
c = E("c")
m = F("m")
g = G("g")
b = H("b")
e = I("e")
l = G("l")

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