class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: B = None
        self.y: F = None
        self.z: I = None
        self.t: J = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: A = None
        self.r: I = None
        self.x: A = None
        self.w: F = None
        self.v: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.t: G = None
        self.y: A = None
        self.x: I = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.z: A = None
        self.u: C = None
        self.y: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.t: E = None
        self.u: A = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: A = None
        self.r: I = None
        self.x: A = None
        self.w: F = None
        self.v: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.t: G = None
        self.y: A = None
        self.x: I = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.z: A = None
        self.u: C = None
        self.y: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.t: E = None
        self.u: A = None
        self.q: B = None
        self.txt = txt

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

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