class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: J = None
        self.p: J = None
        self.q: F = None
        self.y: B = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: F = None
        self.q: E = None
        self.z: A = None
        self.t: F = None
        self.p: B = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: I = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.x: D = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: I = None
        self.u: A = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: E = None
        self.o: G = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

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

f = A("f")
c = B("c")
j = C("j")
e = D("e")
k = E("k")
g = F("g")
b = G("b")
a = H("a")
i = I("i")
h = J("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: F = None
        self.q: E = None
        self.z: A = None
        self.t: F = None
        self.p: B = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: I = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.x: D = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: I = None
        self.u: A = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: E = None
        self.o: G = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

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

f = A("f")
c = B("c")
j = C("j")
e = D("e")
k = E("k")
g = F("g")
b = G("b")
a = H("a")
i = I("i")
h = J("h")

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