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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: H = None
        self.u: B = None
        self.o: G = None
        self.r: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: H = None
        self.r: H = None
        self.x: B = None
        self.u: F = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: H = None
        self.u: B = None
        self.o: G = None
        self.r: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: H = None
        self.r: H = None
        self.x: B = None
        self.u: F = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

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

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

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

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