class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: G = None
        self.u: G = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: F = None
        self.s: C = None
        self.v: E = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.u: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: F = None
        self.s: C = None
        self.v: E = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.u: I = None
        self.txt = txt

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

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

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

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