class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: B = None
        self.y: E = None
        self.w: E = None
        self.q: D = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.y: A = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.p: D = None
        self.x: H = None
        self.r: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: I = None
        self.s: H = None
        self.r: I = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.y: A = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.p: D = None
        self.x: H = None
        self.r: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: I = None
        self.s: H = None
        self.r: I = None
        self.w: A = None
        self.txt = txt

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

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