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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.r: A = None
        self.u: B = None
        self.s: E = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.v: A = None
        self.y: F = None
        self.u: I = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: I = None
        self.u: H = None
        self.p: G = None
        self.v: I = None
        self.t: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.y: F = None
        self.x: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: H = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.r: A = None
        self.u: B = None
        self.s: E = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.v: A = None
        self.y: F = None
        self.u: I = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: I = None
        self.u: H = None
        self.p: G = None
        self.v: I = None
        self.t: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.y: F = None
        self.x: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: H = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

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

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