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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.s: I = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.z: H = None
        self.y: E = None
        self.o: G = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: E = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: G = None
        self.t: G = None
        self.o: A = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.y: F = None
        self.x: E = None
        self.u: C = None
        self.r: F = None
        self.q: D = None
        self.v: D = None
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.s: I = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.z: H = None
        self.y: E = None
        self.o: G = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: E = None
        self.u: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: G = None
        self.t: G = None
        self.o: A = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.y: F = None
        self.x: E = None
        self.u: C = None
        self.r: F = None
        self.q: D = None
        self.v: D = None
        self.o: H = None
        self.txt = txt

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

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