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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: E = None
        self.w: C = None
        self.v: B = None
        self.t: G = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.s: G = None
        self.y: G = None
        self.q: E = None
        self.p: I = None
        self.w: A = None
        self.r: I = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: F = None
        self.t: D = None
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: E = None
        self.w: C = None
        self.v: B = None
        self.t: G = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.s: G = None
        self.y: G = None
        self.q: E = None
        self.p: I = None
        self.w: A = None
        self.r: I = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: F = None
        self.t: D = None
        self.v: E = None
        self.txt = txt

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

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