class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.w: I = None
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: G = None
        self.u: E = None
        self.p: F = None
        self.w: G = None
        self.t: D = None
        self.o: F = None
        self.v: I = None
        self.z: I = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: G = None
        self.u: E = None
        self.p: F = None
        self.w: G = None
        self.t: D = None
        self.o: F = None
        self.v: I = None
        self.z: I = None
        self.txt = txt

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

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

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