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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: A = None
        self.u: F = None
        self.r: I = None
        self.v: D = None
        self.z: I = None
        self.x: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: F = None
        self.w: H = None
        self.q: H = None
        self.s: A = None
        self.r: D = None
        self.o: B = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: I = None
        self.o: A = None
        self.y: I = None
        self.x: I = None
        self.z: F = None
        self.s: A = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: A = None
        self.u: F = None
        self.r: I = None
        self.v: D = None
        self.z: I = None
        self.x: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: F = None
        self.w: H = None
        self.q: H = None
        self.s: A = None
        self.r: D = None
        self.o: B = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: I = None
        self.o: A = None
        self.y: I = None
        self.x: I = None
        self.z: F = None
        self.s: A = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

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

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

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