class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: D = None
        self.r: I = None
        self.x: A = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: E = None
        self.s: G = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: D = None
        self.s: E = None
        self.t: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: D = None
        self.r: I = None
        self.x: A = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: E = None
        self.s: G = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: D = None
        self.s: E = None
        self.t: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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