class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.v: F = None
        self.z: G = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.v: F = None
        self.z: G = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: B = None
        self.txt = txt

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

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

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