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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: I = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: C = None
        self.o: C = None
        self.r: G = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: B = None
        self.txt = txt

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

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

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

a.q = h
a.x = d
a.t = f
a.s = j
a.o = j
a.z = e
a.w = e
a.r = k
h.z = e
h.o = e
h.t = k
h.s = j
h.x = c
h.q = a
h.w = n
h.v = d
n.r = c
n.u = j
n.y = j
d.z = n
d.v = j
d.q = h
d.p = h
d.o = h
d.s = a
d.t = k
d.u = k
d.w = c
f.o = n
c.p = j
c.v = n
c.o = n
c.r = e
c.q = f
e.y = k
e.s = h
k.z = j
k.s = d
k.x = f
j.o = e
j.z = k
j.s = f
assert k.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: D = None
        self.t: E = None
        self.s: I = None
        self.z: G = None
        self.o: I = None
        self.w: G = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: I = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: C = None
        self.o: C = None
        self.r: G = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: B = None
        self.txt = txt

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

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

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

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