class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: G = None
        self.p: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: G = None
        self.o: H = None
        self.z: F = None
        self.x: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: D = None
        self.w: A = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: G = None
        self.o: H = None
        self.z: F = None
        self.x: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: D = None
        self.w: A = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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