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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: C = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: E = None
        self.u: I = None
        self.z: E = None
        self.t: H = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: H = None
        self.p: A = None
        self.u: H = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.o: G = None
        self.y: A = None
        self.r: D = None
        self.p: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: C = None
        self.t: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: E = None
        self.u: I = None
        self.z: E = None
        self.t: H = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: H = None
        self.p: A = None
        self.u: H = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.o: G = None
        self.y: A = None
        self.r: D = None
        self.p: C = None
        self.txt = txt

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

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

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