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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: G = None
        self.u: D = None
        self.w: I = None
        self.r: A = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: F = None
        self.o: E = None
        self.u: C = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.q: E = None
        self.p: B = None
        self.o: F = None
        self.t: G = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: G = None
        self.u: D = None
        self.w: I = None
        self.r: A = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: F = None
        self.o: E = None
        self.u: C = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.q: E = None
        self.p: B = None
        self.o: F = None
        self.t: G = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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