class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: A = None
        self.q: C = None
        self.z: F = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: A = None
        self.s: B = None
        self.r: A = None
        self.z: E = None
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: G = None
        self.txt = txt

c = A("c")
a = B("a")
l = C("l")
i = D("i")
b = E("b")
g = F("g")
m = G("m")
j = H("j")
d = I("d")

c.q = a
c.z = a
c.x = a
a.o = d
a.s = c
a.q = l
a.z = g
a.v = b
l.r = c
i.q = a
i.t = a
i.z = b
i.o = j
i.x = j
i.u = d
i.s = d
b.u = j
b.r = j
b.v = m
b.t = a
b.s = g
b.o = l
g.s = a
g.p = a
g.w = c
g.r = c
m.v = d
m.o = c
m.r = c
m.s = a
m.q = a
m.z = b
j.t = i
d.v = a
d.x = m
assert d.x.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: A = None
        self.q: C = None
        self.z: F = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: A = None
        self.s: B = None
        self.r: A = None
        self.z: E = None
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: G = None
        self.txt = txt

c = A("c")
a = B("a")
l = C("l")
i = D("i")
b = E("b")
g = F("g")
m = G("m")
j = H("j")
d = I("d")

c.q = a
c.z = a
c.x = a
a.o = d
a.s = c
a.q = l
a.z = g
a.v = b
l.r = c
i.q = a
i.t = a
i.z = b
i.o = j
i.x = j
i.u = d
i.s = d
b.u = j
b.r = j
b.v = m
b.t = a
b.s = g
b.o = l
g.s = a
g.p = a
g.w = c
g.r = c
m.v = d
m.o = c
m.r = c
m.s = a
m.q = a
m.z = b
j.t = i
d.v = a
d.x = m
assert d.x.v.v.txt == "a"