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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: E = None
        self.x: F = None
        self.r: A = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: I = None
        self.y: I = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: D = None
        self.o: G = None
        self.v: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: E = None
        self.x: F = None
        self.r: A = None
        self.p: E = None
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: I = None
        self.y: I = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: D = None
        self.o: G = None
        self.v: E = None
        self.txt = txt

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

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