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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: A = None
        self.x: D = None
        self.t: D = None
        self.y: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: G = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: F = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: A = None
        self.x: D = None
        self.t: D = None
        self.y: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: G = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: F = None
        self.v: H = None
        self.txt = txt

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

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

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

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