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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: H = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.r: H = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.z: F = None
        self.w: F = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.v: F = None
        self.u: A = None
        self.t: E = None
        self.w: G = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: H = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.r: H = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.z: F = None
        self.w: F = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.v: F = None
        self.u: A = None
        self.t: E = None
        self.w: G = None
        self.r: B = None
        self.txt = txt

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

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