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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: I = None
        self.r: C = None
        self.p: A = None
        self.z: A = None
        self.s: I = None
        self.q: G = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: G = None
        self.x: F = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: A = None
        self.p: E = None
        self.z: E = None
        self.t: A = None
        self.y: I = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: I = None
        self.r: C = None
        self.p: A = None
        self.z: A = None
        self.s: I = None
        self.q: G = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: G = None
        self.x: F = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: A = None
        self.p: E = None
        self.z: E = None
        self.t: A = None
        self.y: I = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.txt = txt

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

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

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