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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: G = None
        self.w: I = None
        self.u: B = None
        self.y: D = None
        self.t: H = None
        self.z: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: D = None
        self.y: G = None
        self.v: C = None
        self.o: A = None
        self.s: C = None
        self.u: C = None
        self.z: H = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.txt = txt

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

f = A("f")
k = B("k")
c = C("c")
a = D("a")
j = E("j")
m = F("m")
e = G("e")
n = H("n")
b = I("b")

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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: G = None
        self.w: I = None
        self.u: B = None
        self.y: D = None
        self.t: H = None
        self.z: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: D = None
        self.y: G = None
        self.v: C = None
        self.o: A = None
        self.s: C = None
        self.u: C = None
        self.z: H = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.txt = txt

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

f = A("f")
k = B("k")
c = C("c")
a = D("a")
j = E("j")
m = F("m")
e = G("e")
n = H("n")
b = I("b")

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