class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: I = None
        self.v: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.o: D = None
        self.z: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: D = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: I = None
        self.v: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.o: D = None
        self.z: E = None
        self.t: D = None
        self.txt = txt

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

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

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