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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: I = None
        self.o: G = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: I = None
        self.p: I = None
        self.t: G = None
        self.v: I = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.x: D = None
        self.t: H = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: C = None
        self.s: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: I = None
        self.o: G = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: I = None
        self.p: I = None
        self.t: G = None
        self.v: I = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.x: D = None
        self.t: H = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: C = None
        self.s: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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