class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: B = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: A = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: G = None
        self.t: C = None
        self.v: F = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: A = None
        self.s: I = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: H = None
        self.p: D = None
        self.q: C = None
        self.y: E = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: A = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: G = None
        self.t: C = None
        self.v: F = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: A = None
        self.s: I = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: H = None
        self.p: D = None
        self.q: C = None
        self.y: E = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

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

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