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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: F = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: F = None
        self.t: E = None
        self.txt = txt

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

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