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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: G = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
l = C("l")
h = D("h")
g = E("g")
f = F("f")
a = G("a")
b = H("b")
d = I("d")

i.r = d
i.q = f
e.x = d
e.q = a
e.z = h
l.w = a
h.y = g
h.q = e
g.o = f
f.y = e
f.s = d
f.r = d
f.t = l
f.p = l
f.w = g
f.v = b
f.z = b
f.x = h
a.o = l
b.q = a
d.p = f
d.r = f
d.t = l
d.z = l
assert g.o.t.w.o.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: G = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
l = C("l")
h = D("h")
g = E("g")
f = F("f")
a = G("a")
b = H("b")
d = I("d")

i.r = d
i.q = f
e.x = d
e.q = a
e.z = h
l.w = a
h.y = g
h.q = e
g.o = f
f.y = e
f.s = d
f.r = d
f.t = l
f.p = l
f.w = g
f.v = b
f.z = b
f.x = h
a.o = l
b.q = a
d.p = f
d.r = f
d.t = l
d.z = l
assert g.o.t.w.o.w.o.w.txt == "a"