class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: G = None
        self.q: F = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: H = None
        self.r: A = None
        self.u: A = None
        self.x: D = None
        self.t: D = 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.x: G = None
        self.u: H = None
        self.r: H = None
        self.o: H = None
        self.y: G = None
        self.p: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.x: C = None
        self.p: I = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: H = None
        self.s: H = None
        self.x: B = None
        self.v: A = None
        self.u: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: H = None
        self.r: A = None
        self.u: A = None
        self.x: D = None
        self.t: D = 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.x: G = None
        self.u: H = None
        self.r: H = None
        self.o: H = None
        self.y: G = None
        self.p: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.x: C = None
        self.p: I = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: H = None
        self.s: H = None
        self.x: B = None
        self.v: A = None
        self.u: H = None
        self.txt = txt

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

b.v = g
b.u = g
b.q = d
b.p = n
b.s = n
m.y = h
m.v = f
m.r = b
m.u = b
m.x = n
m.t = n
i.r = b
n.x = g
n.y = g
n.u = f
n.r = f
n.o = f
n.p = f
h.u = d
h.x = d
h.p = d
h.y = b
h.s = b
h.z = l
h.w = i
h.v = n
h.q = f
d.s = i
d.q = g
g.w = b
g.r = f
g.x = i
g.p = l
g.z = n
g.s = h
f.u = l
f.y = m
l.t = i
l.q = f
l.s = f
l.u = f
l.x = m
l.v = b
assert l.x.r.q.txt == "d"