class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.p: D = None
        self.t: I = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.y: G = None
        self.v: B = None
        self.t: H = None
        self.o: I = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: C = None
        self.x: B = None
        self.s: D = None
        self.r: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.y: A = None
        self.w: F = None
        self.q: E = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: D = None
        self.w: D = None
        self.y: C = None
        self.u: H = None
        self.q: E = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.p: D = None
        self.t: I = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.y: G = None
        self.v: B = None
        self.t: H = None
        self.o: I = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: C = None
        self.x: B = None
        self.s: D = None
        self.r: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.y: A = None
        self.w: F = None
        self.q: E = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: D = None
        self.w: D = None
        self.y: C = None
        self.u: H = None
        self.q: E = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

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

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