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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: I = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: D = None
        self.w: A = None
        self.q: C = None
        self.o: H = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: F = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: I = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: D = None
        self.w: A = None
        self.q: C = None
        self.o: H = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: F = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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