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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: C = None
        self.o: H = None
        self.x: B = None
        self.w: H = None
        self.v: E = None
        self.z: I = None
        self.t: H = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: C = None
        self.r: D = None
        self.y: E = None
        self.p: I = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: C = None
        self.o: H = None
        self.x: B = None
        self.w: H = None
        self.v: E = None
        self.z: I = None
        self.t: H = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: C = None
        self.r: D = None
        self.y: E = None
        self.p: I = None
        self.o: C = None
        self.s: F = None
        self.txt = txt

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

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

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