class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.u: C = None
        self.r: D = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: I = None
        self.x: I = None
        self.q: C = None
        self.o: H = None
        self.t: I = None
        self.s: F = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: G = None
        self.w: H = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.u: C = None
        self.r: D = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: I = None
        self.x: I = None
        self.q: C = None
        self.o: H = None
        self.t: I = None
        self.s: F = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: G = None
        self.w: H = None
        self.t: H = None
        self.txt = txt

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

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